Open jbraithwaite opened 9 years ago
@jbraithwaite I'm interested. How would you do that? I've just started investigating isomorphic JS apps (Particularly via Meteor) but am a bit clueless about the ins and outs of them.
I don't plan on supporting rendering of the graphs on the server (at least not initially). I want to be able to require('c3')
in my app without throwing errors.
I haven't tried Meteor but if you are willing to give React a whirl, you can download my react boilerplate and try requiring c3
in home.jsx to see where this library fails. Here are the steps.
$ git clone git@github.com:jbraithwaite/react-boilerplate.git
$ cd react-boilerplate/
$ npm install
$ npm install --save c3
$ vi app/routes/home.jsx
Add
var c3 = require('c3');
Back in terminal
$ gulp
@jbraithwaite Apols for the delay getting back to you! I've totally made a Meteor app in the meantime and am now trying your React boilerplate. If C3's wanting the window
object, that probably means it doesn't really work in NodeJS either, which it should.
Edit: Just noticed that console.log
is even prefaced with window.
, such as here. That really shouldn't be the case, because NodeJS uses console.log but doesn't have window
.
@jbraithwaite In terms of your initial suggestion — a PR would be very much appreciated. I'm wanting to do some React stuff fairly soon, and being able to use C3 with it would be the bee's knees. :smile: :+1: :shipit:
Awesome, I'll get started on this.
This would be really cool! https://github.com/Olical/react-faux-dom makes it possible to render D3 charts with React server-side - would be awesome to be able to do the same using c3.
Do you have any update with this issue?
There is a lot of reliance on
window
existing, which is not the case on the server.If I submit a pull request, is this something you'd merge?