GithubHelp home page GithubHelp logo

Comments (8)

mbostock avatar mbostock commented on April 25, 2024

Sounds like both d3-fetch and NVD3 define d3.svg, so you won’t be able to use them together. Sorry!

from d3-fetch.

gordonwoodhull avatar gordonwoodhull commented on April 25, 2024

Generally, you can't include d3@3 and d3@4+ in the same HTML file.

I needed to load d3v4-force into a d3@3 project and I had luck using rollup to produce a bundle that exposed the d3@4 code as d3v4 instead of d3.

https://github.com/dc-js/dc.graph.js/blob/develop/d3v4-force.rollup.config.js

(Doing a sed search-and-replace also worked, but this is more elegant.)

from d3-fetch.

JetForMe avatar JetForMe commented on April 25, 2024

Sounds like both d3-fetch and NVD3 define d3.svg, so you won’t be able to use them together. Sorry!

Why does something designed for fetching data define d3.svg?

Generally, you can't include d3@3 and d3@4+ in the same HTML file.

I was aware the NVD3 couldn't use d3 v4, but I thought I was avoiding that, following their examples. I'm not using node, so I'm not sure how to incorporate your solution.

from d3-fetch.

JetForMe avatar JetForMe commented on April 25, 2024

Oh I see, you parse SVG. I think I'll just modify my copy to change the definition.

from d3-fetch.

JetForMe avatar JetForMe commented on April 25, 2024

Or maybe you could make everything live under d3.fetch?

from d3-fetch.

mbostock avatar mbostock commented on April 25, 2024

Sorry, but I’m not going to rename this method. The d3.svg namespace was removed from D3 in 4.0 which was released in 2016. This module added a new d3.svg method (parallel to d3.xml, d3.text, d3.json, etc.) in 2018.

from d3-fetch.

gordonwoodhull avatar gordonwoodhull commented on April 25, 2024

d3-fetch is circa d3@5 so it’s not compatible with d3@3 used by NVD3.

My rollup solution has nothing to do with Node. It’s just a way to bundle individual D3 ES6 modules to replaced3-fetch.v1.js with something that don’t write to the global d3 namespace.

It’s basically the same way the official D3 bundles are created.

from d3-fetch.

JetForMe avatar JetForMe commented on April 25, 2024

Ah I see. Well, I did search and replace, which worked, but then couldn't get NVD3 to do what I wanted, to I switched to C3.

from d3-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.