Modifying inline styles fails sometimes

  // Changing c.svg's inline style from absolute to relative doesn't work{position: 'relative'})'position', 'relative')
  console.log('position'))  // relative
  console.log('svg').style('position')) // Back to absolute!!

  // This does work? Comment out to see chart overlapping with text above'svg').st({position: 'relative'})
  console.log('position'))  // relative

Not sure why reselecting would make any difference.

This appears to be a d3-jetpack issue and was fixed (by you!) in 2.0.16. If you upgrade from 2.0.15 the problem goes away. Try replacing your d3 cell as follows:

d3 = require("d3-jetpack@2.0.16/build/d3v4+jetpack.js")

The reason that this line doesn’t work:{position: 'relative'})

Is that c.svg is the G element, not the parent SVG element. So you’re getting this:

<svg width="100" height="18" style="position: absolute;">
  <g transform="translate(0,0)" style="position: relative;">

This line works fine:'svg').st({position: 'relative'})
1 Like

oh dear. That’s what I get for filing an issue after midnight!