susielu/d3-annotation

d3-svg-annotation().annotations()

Closed this issue · 1 comments

This is not a issue, but a question on how to use d3-svg-annotation with node.js require()
In my server.js file, I have
require('d3-svg-annotation');

When I tried this command:
d3-svg-annotation().annotations()

I get an error:
d3-svg-annotation().annotations()
ReferenceError: svg is not defined

This may be basic question, but I could not find how d3-svg-annotation can be used when we render on the server using node.

Any clue will be very helpful

Thank you

I figured it out.Ity was my typo.
d3_annotation = require('d3-svg-annotation');
and found the methods:
[ 'annotation',
'annotationTypeBase',
'annotationLabel',
'annotationCallout',
'annotationCalloutCurve',
'annotationCalloutElbow',
'annotationCalloutCircle',
'annotationCalloutRect',
'annotationXYThreshold',
'annotationBadge',
'annotationCustomType' ]