dygraphs
dygraphs copied to clipboard
ReferenceError: Dygraph is not defined
I am using react and I want to use the hairlines plugins of the dygraph. But whenever I am trying to use that plugin after compilation in the browser error comes dygraph is not defined. It comes from the hairline.js in the dygraph node module.
I import this two files as shown in the example but than also the error comes. import Dygraph from 'dygraphs/dist/dygraph' import Hairlines from 'dygraphs/src/extras/hairlines'
I tried import Dygraphs from 'dygraphs/index.es5'; import Hairlines from 'dygraphs/src/extras/hairlines' but same error was coming
To make it work I am editing the hairline.js and adding the import Dygraph from '../../index.es5' line and after that it is working perfectly fine. But as this is a node module and everyone will install on their laptops all of them need to edit it.
Am I missing some other imports or is there any other way we can use the hairlines plugin.
@danvk
it seems similar to https://github.com/danvk/dygraphs/issues/848
Yeah, let’s track this in #848 instead. I think I actually know what to do now, but it’s bedtime. @chiubaca accidentally gave me what I needed to figure it out.