score:1
Well, I just had a chat with Mike Bostock and he pointed out what the issue is. In the full code, there is also a popupclose event:
map.on('popupclose', function(e) {
rects
.attr("width", 0);
});
This code is only resetting width to 0 but Y needs to be reset to height as well. So, this code is fixing the issue:
map.on('popupclose', function(e) {
rects
.attr("width", 0)
.attr("y", function(d) {return height; });
});
As an added bonus, Mike gave me very insightful feedback. He doesn't recommend using transition the way I have here. he says it introduces distraction and delay and its not informative. It would be best to keep transitions for when switching between datasets (Object constancy). After review, I have to agree so I will not pursue this animation as an aesthetic property of my visualizations.
Source: stackoverflow.com
Related Query
- D3 transition not working as intended
- D3.js transition not working as intended
- d3 transition for transform translate not working for DIV
- D3 transition not working
- d3 v4 line chart transition not working
- D3.v4 Projection Transition not Working
- Transition not working
- d3 transition on tooltip not working
- D3.js v4 circle radius transition not working as expected
- Transition on path in d3.js is not working
- Transition In D3 Bar Graph Not Working
- d3 transition not working when triggered from mouseover/mouseout handler
- d3 js transition not working
- D3 realtime graphing: slide from right&shift data as data length exceeds limit transition is not working
- D3 Transition not working as expected
- D3 General update pattern transition not working on pie chart
- D3 fill transition for heatmap not working
- SVG path transition in D3 (v5) not working properly
- D3 transition working on "background-color" but not on "width"
- d3js Opacity Transition Not Working as Expected
- Transition not working d3
- D3.js path transition not working
- SVG links not working after transition executed in d3.js
- Stacked Bar Chart to Grouped Bar Chart transition not working
- d3.js transition is not working with property method
- d3.js Transition on div not working
- font size is not working in my d3.js code
- d3.select("#element") not working when code above the html element
- Title Attribute not working for an SVG Rect on Safari
- d3.js - mouseover event not working properly on svg group
More Query from same tag
- Hexbins are not showing on geo tile map D3.JS
- how to create multiline chart using dc.js
- d3.js: Transition the colours in an SVG linear gradient?
- Scale padding in D3 v 4
- D3 stacked graphs issue with bar position on x-Axis
- D3: Circle Points don't update when changing slider
- Tipsy tooltip positioning on d3 in firefox, IE
- D3 Tree layout: How to fill rectangles with text, but have them in uniform size?
- D3: change font size of axis labels
- D3 combination of bar and area chart
- Retrieve value from password field
- ReferenceError: d3 is not defined in jest Unit Test
- Two geojson files not superposing
- Calculate mean json with d3.js
- Is there a way to generate more than 20 colors in D3?
- Deleting d3 svg elements for redraw
- How to exit().transition rects under a col in d3
- Grouping text and rect
- Adding a carousel slide handler: works with jquery, fails with d3 select?
- Saving a SVG, background image is left out
- How do I use JSON and return data with D3
- same size circles in pack layout in d3.v4.js
- React + d3 multiple charts components with different data
- How to select the color of node on data value and the Data value of tool as name?
- Reading columns in their order of the csv file
- Need help in ngx-graph links layout
- Show content from data in tooltip d3
- Magnifier in d3
- Updating an HTML table in d3.js using a reusable chart
- Getting a better performance on repeatedly method on d3