All examples By author By category About

micahstubbs

ES2015 X-Value Mouseover with Droplines

a ES2015 fork of @micahstubbs' bl.ock X-Value Mouseover with Droplines

this example also converts all CSS styles previously inside of the <style></style> HTML tags into inline styles applied in Javascript to d3 selections.

this CSS that styles the droplines:

.focus line {
  fill: none;
  stroke: black;
  stroke-width: 1.5px;
  stroke-dasharray: 3 3;
}

becomes this Javascript that does the same thing:

    d3.selectAll('.focus line')
      .style({
        fill: 'none',
        'stroke': 'black',
        'stroke-width': '1.5px',
        'stroke-dasharray': '3 3'
      })

inline styles can make it easier to quickly include d3js examples like this into a larger Javascript project that is automatically built from many source files into one bundle file.