score:0
The reason was that you can't start elements with numbers. I had to do:
var responseNode = group.append("n"+id).attr("fill","black").attr("x", 15).attr("y", 15).attr("width", 190).attr("height", 90);
to get it to work.
score:1
I believe that I understand your problem.
D3's .append():
If the specified type is a string, appends a new element of this type (tag name) as the last child of each selected element, or the next following sibling in the update selection if this is an enter selection. [...] This function should return an element to be appended. (The function typically creates a new element, but it may instead return an existing element.
Why .append() work fine if you pass 'foo'
? Because D3 append a custom tag element. If you see in your console I'am sure that you will see <foo>...</foo>
Why .append() work wrong if you pass '5802bc044f6313c1097de4a2'
? A custom tag element can't start with a number. You don't use _id
, you should try to find another pattern for identify your element.
I hope that helps
Source: stackoverflow.com
Related Query
- D3 invalid character in element
- D3.js text element does not display unicode character correctly
- appending entire svg to dom element leads to Exception... "String contains an invalid character" code: "5"
- Render space as only character in div text element
- d3 react js - Failed to execute 'createElementNS' on 'Document': The qualified name provided contains the invalid character ','
- Updating SVG Element Z-Index With D3
- How to access the DOM element that correlates to a D3 SVG object?
- How to select parent element of current element in d3.js
- How to center text in a rect element in d3?
- Accessing d3.js element attributes from the datum?
- d3.select("#element") not working when code above the html element
- D3.js: Position tooltips using element position, not mouse position?
- How do I get the width of an svg element using d3js?
- D3 Differentiate between click and drag for an element which has a drag behavior
- read width of d3 text element
- Get one element from d3js selection, by index
- Finding Offset Position of SVG Element
- D3 Selecting an element inside an SVG
- D3 get attributes from element
- Append SVG canvas to element other than body using D3
- How to turn a raw DOM element in to a D3 selection?
- d3js : How to select nth element of a group?
- make sure d3 data element matches id?
- Append DOM element to the D3
- Get width of d3.js SVG text element after it's created
- D3 - Positioning tooltip on SVG element not working
- D3.js - JSON data array is binding the same array element to everything
- SVG element loses event handlers if moved around the DOM
- D3 get previous element in .data()
- StopPropagation() with SVG element and G
More Query from same tag
- How do I use d3's brushing/dragging/zoom behaviors in a meteor project?
- D3: Change text in url without making request
- Different colors for each circle - D3 circle pack
- Can't find name dimension during the Integration of D3 PCP with Angular4
- Issues drawing multiple NVD3.js charts on dynamically-created div
- Simple React Map layer not loading until mouseEnter event
- Simulating Light (Point Source) in 2D Room
- D3 tooltip that is also a a D3 viz
- Changing zoom in D3.js from mousewheel to control+mousewheel
- Add Limit Lines to D3.js Line Graph
- d3JS: iterate through paths of unknown point count
- d3.behavior.drag + keydown event
- How do I get my topojson file to work with datamaps?
- Object in javascript stuck on last line of csv file
- How To Move (Drag and Drop) multiple Shapes with D3
- D3: Resizing x axis and repositioning circles
- How best to work with raw (uncounted) data in d3.js?
- ngClick causes D3 chart to redraw
- How to maintain text size in a responsive SVG?
- Converting JSON format to CSV to upload data table in R to produce D3 bubble chart
- How to fill area with our choice colour in plotly area grap
- d3 globe - says rotate is not a function
- How to adjust event.pageY to my new modal dialog?
- How to disable double click zoom for d3.behavior.zoom?
- D3.js .selectAll not working
- Parallel Coordinates with check box
- D3 does not maintain object constancy even when there is a key function
- Connecting two rectangles in d3js
- D3 Sankey Diagram: Adding New Node and Link with Transition
- Data enter/exit handler