Frappé Gantt only supports usage of a string CSS selector, HTML DOM element or SVG DOM element for the 'element' parameter - gantt-chart

Can any one explain about this error message.
Need explanation for this error
Frappé Gantt only supports usage of a string CSS selector, HTML DOM element or SVG DOM element for the 'element' parameter

Related

Unable to find SVG elements

I have some of the elements under SVG.
I am trying to access them using CSS selector:
cy.get('element selector').click(), it says:
unable to find the element using that selector.
But, with the same selector I am able to identify element in the browser using chropath.
Please help me.
Latest version of ChroPath 6.0 supports the svg elements and svg child elements. Just inspect the svg elements or click on svg DOM node, ChroPath will generate the relative xpath for them.

SVG: Is the "font-size" attribute allowed in "<g>" Elements?

The SVG 1.1 standard says that the font-size attribute is allowed in text content elements. The <g> element is not a text content element. Conclusively, the <g font-size="45"/> is illegal.
However, many examples in the standard show <g>-elements with the font-size attribute.
Is the attribute allowed in <g> elements or are the examples showing invalid code?
font-size is an inherited CSS property so if you set it on a parent element, it applies to all that element's children.
It can have an indirect effect on non-text elements if they use em or ex units i.e. they are sized relative to the font-size. What the specification is trying (pretty poorly) to say is that setting a font-size on a rect element won't have any effect.
The specification for a g element is explicit that font-size is a property it supports. Click on the presentation-attributes link in the g element section on that page and the text will expand to show font-size as a supported attribute.

SVG <use> element transition not working

I'm trying to use CSS transisions with SVG <use> element.
The problem is that the transition works with the original element but not inside the element on adding/removing class through classList.
However when I disable the transform property in the browser tools, it works.
Can someone help with this?
The small element is the source element which works, The bigger one is using <use>
https://codepen.io/karanS/pen/GqVLGv

Browser support for SVG <use>?

I'm having a hard time finding some precise information on the browser support for the <use> element to include inline SVGs. There is a Can I Use page on SVG fragment identifiers, but as I understand this is only for the <view> element. Any idea?

How do I set an SVG element to my page's favicon?

I have an SVG element on my page. I want to use it as the page's favicon. How do I do this in JavaScript?
Doing this is astoundingly convoluted. You can see my solution in action here: the methodology is described below (getting the HTML elements, by ID or otherwise, is left as an exercise for the reader).
In the HTML
Make sure your SVG element includes the attribute xmlns="http://www.w3.org/2000/svg", as you're going to need to take the source of the element as its own file, and the XMLNS declaration is required for standalone SVG files. (Also note that this means your SVG will need to be self-contained and can't refer to elements in its parent document with something like <use>.)
Optionally, wrap the element in a <div> or <span>, which you may use to get the content of the <svg> element using .innerHTML. (Neither the innerHTML nor the outerHTML attributes are present on SVG elements in the current HTML standard.)
Include a <link rel="icon"> in your page's <head>.
In JavaScript
Get the source of the SVG element you want to set as your favicon by getting the innerHTML attribute of the HTML element you've wrapped it in, or by calling new XMLSerializer().serializeToString() on the SVG element.
Create a DataURL for this element as a document by prepending the string "data:image/svg+xml," to the source. (If most browsers supported SVGs for favicons, we'd be done here, but since, at time of writing, they don't, we must go deeper.)
Create an <img> element that you'll be routing the image through, add an event listener to it for the load event that will draw the image once control returns to the event loop (as spec-compliant browsers won't let you read the image synchronously - see this crbug), and set the DataURL of your SVG source as its src attribute. (The steps between this and step 8 can happen either in sync now, or as part of the listener callback; they just need to happen before you draw the image.)
Decide what resolution you want to render your favicon to - My examples will use 64x64, for compatibility with high-DPI (Retina and Super Retina) displays.
Create a <canvas> element (heretofore referred to as canvasElement) and set its dimensions (by setting canvasElement.width = 64 and canvasElement.height = 64).
Create a drawing context for the canvas using canvasElement.getContext('2d') (heretofore referred to as ctx).
If you're re-using a canvas you've created beforehand, set ctx.globalCompositeOperation = "copy", or clear it with ctx.clearRect(0, 0, 64, 64).
Somewhere in the execution sequence following from the load listener you added to the <img> element you created in step 3, draw the image onto the canvas using ctx.drawImage(svgImg, 0, 0, 64, 64) (where svgImg is the <img> element you set the src to the SVG DataURL).
Create a PNG DataURL from the canvas using canvasElement.toDataURL(), and set that to the href attribute of the <link rel="icon"> element in your HTML.
I know its already answered but It too much work for such a simple task just store your svg in a svg file and use it as favicon in Head Tag.
<link rel="shortcut icon" href="favicon.svg" type="image/x-icon">
I have tried and this worked for me:
<link rel="shortcut icon" href="favicon.svg" type="image/svg">
Change the type="image/x-icon" to type="image/svg".

Resources