GithubHelp home page GithubHelp logo

Comments (3)

ahwelgemoed avatar ahwelgemoed commented on April 29, 2024 10

I ran into a similar issue on a big project that still uses D3 V4.11.0 - .lock file got deleted and a reinstall generated this issue - Long story - I found that yarn didn't work and npm install did work -

For me the issue was with how peer dependency installs and resolve work with Yarn.
Read more here

I added this to my package.json

"resolutions": { "d3-selection": "1.1.0", "d3-dispatch": "1.0.6", "d3-brush": "1.1.4" },

And it fixed

from d3-brush.

mbostock avatar mbostock commented on April 29, 2024 5

d3-dispatch 1.0.6 added error checking for the type names passed to d3.dispatch. This revealed a bug in d3-brush where the brush function itself was being erroneously passed to d3.brush; this bug was fixed in d3-brush 1.1.4.

The second change you’re describing was included in d3-scale 2.2.0 (#113 #117). The behavior of a scale with a collapsed domain was previously not defined, so this change defined it as returning the midpoint of the range rather than the start.

In general, semantic versioning only means that supported behaviors continue working as defined in patch (and minor) releases. In both of these cases, the previous behaviors were neither intended or documented; they just happened to fall out of the existing implementation. I make a best effort to define what behaviors are supported in documentation (and verify said behavior in tests), but I’m not perfect, and there is undoubtedly other unsupported edge case behavior that may change over time. The only way to ensure that unsupported behaviors don’t change is to pin exact versions. If you’d like to contribute documentation to the README to better define supported behaviors, that would be welcome!

from d3-brush.

34r7h avatar 34r7h commented on April 29, 2024 3

I've got the same using d3-brush version 1.1.5

`client.js?06a0:77 Error: illegal type: function brush(group) {
var overlay = group
.property("__brush", initialize)
.selectAll(".overlay")
.data([type("overlay")]);

overlay.enter().append("rect")
    .attr("class", "overlay")
    .attr("pointer-events", "all")
    .attr("cursor", cursors.overlay)
  .merge(overlay)
    .each(function() {
      var extent = local(this).extent;
      Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this)
          .attr("x", extent[0][0])
          .attr("y", extent[0][1])
          .attr("width", extent[1][0] - extent[0][0])
          .attr("height", extent[1][1] - extent[0][1]);
    });

group.selectAll(".selection")
  .data([type("selection")])
  .enter().append("rect")
    .attr("class", "selection")
    .attr("cursor", cursors.selection)
    .attr("fill", "#777")
    .attr("fill-opacity", 0.3)
    .attr("stroke", "#fff")
    .attr("shape-rendering", "crispEdges");

var handle = group.selectAll(".handle")
  .data(dim.handles, function(d) { return d.type; });

handle.exit().remove();

handle.enter().append("rect")
    .attr("class", function(d) { return "handle handle--" + d.type; })
    .attr("cursor", function(d) { return cursors[d.type]; });

group
    .each(redraw)
    .attr("fill", "none")
    .attr("pointer-events", "all")
    .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)")
    .on("mousedown.brush touchstart.brush", started);

}
at dispatch (dispatch.js?b99e:5)
at brush (brush.js?f6ce:138)
at Module.brushX (brush.js?f6ce:124)
at eval (d3_timeseries.js?fe78:50)
at eval (timeseries.vue?b547:38)
at Module../node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./components/timeseries.vue?vue&type=script&lang=js& (index.js:47)
at webpack_require (runtime.js:791)
at fn (runtime.js:151)
at eval (timeseries.vue?1a99:1)
at Module../components/timeseries.vue?vue&type=script&lang=js& (index.js:23)`

from d3-brush.

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.