Giter Site home page Giter Site logo

Comments (9)

cranetm avatar cranetm commented on June 13, 2024 1

oh, God. its simplier than I thought.
test: /\.woff|woff2|ttf|eot|svg|png|jpg$/, and d3-svg-legend matches by svg word
the right pattern should be /\.(woff|woff2|ttf|eot|svg|png|jpg)$/

from d3-legend.

susielu avatar susielu commented on June 13, 2024

I just checked and this worked for me. Are you sure you're not accidentally overriding that legend variable at some point later in your script?

from d3-legend.

susielu avatar susielu commented on June 13, 2024

This is the output I'm getting
image

from d3-legend.

cranetm avatar cranetm commented on June 13, 2024

Hm, very strange. My output is:
image
image

from d3-legend.

cranetm avatar cranetm commented on June 13, 2024

Just tried with an empty project and it works. Ok, I will play around webpack configuration I have in the real project.
And btw, why I can't import 'default' object by import legend from 'd3-svg-legend' ? I receive an error: module has no default export (again, in typescript).

from d3-legend.

susielu avatar susielu commented on June 13, 2024

Hmmm just tried that and it is working for me. I'm not familiar with typescript, can you tell from the types file if that would impact the default object? https://github.com/susielu/d3-legend/blob/master/types/d3-svg-legend.d.ts

from d3-legend.

susielu avatar susielu commented on June 13, 2024

@cranetm did you have any updates on this?

from d3-legend.

cranetm avatar cranetm commented on June 13, 2024

yeap, I haven't found proper reason, but issue in webpack.config.js.
I have next rule:

{
    test: /\.woff|woff2|ttf|eot|svg|png|jpg$/,
    use: [{
        loader: 'file-loader',
        options: {
            publicPath: '/assets/build/',
            outputPath: 'assets/'
        }
    }]
}

and somehow it copies your lib to my assets folder.
I've fixed it with adding exclude: /d3-svg-legend/, to the rule.

from d3-legend.

susielu avatar susielu commented on June 13, 2024

Oh wow surprised this didn't come up before, good catch.

from d3-legend.

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.