Giter Club home page Giter Club logo

Comments (12)

paranomadic avatar paranomadic commented on July 20, 2024 2

You can use scaleOrdinal( ) in the newest versions.

from d4.

heavysixer avatar heavysixer commented on July 20, 2024

Hi @keesgboog can you post a block builder where I can see your code? blockbuilder.org/

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

Sure, I basically copied your code in the 'getting started'.

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
</head>
<body>
<div id="test">
</div>
<script type="text/javascript">
$(document).ready(function(){
        var data = [
          { x : '2010', y : 5 },
          { x : '2011', y : 15 },
          { x : '2012', y : 20 }
        ];
        var columnChart = d4.charts.column();
        d3.select('test')
          .datum(data)
          .call(columnChart);
});
</script>
<script type="text/javascript" src="d3.js"></script>
<script type="text/javascript" src="d4.js"></script>
</body>

I am working with d3 quite a lot to make dashboards, and am excited about d4's ability to make it easier to draw column charts.

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

oh, and it needed to be:

d3.select('#test')

from d4.

heavysixer avatar heavysixer commented on July 20, 2024

👍 so it works for you now?

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

nope :) sorry. I don't think it gets past
var columnChart = d4.charts.column();
that's where the error:
d4.js:95 Uncaught Error: [d4] The scale type: "ordinal" is unrecognized. D4 only supports these scale types: time, time.utc
comes in... which i can follow to be an error in l.174 function validateScale()
(from the createAxisScale() , where axis.accessors.scale is 'ordinal', which tries to go to:

scale = d3.scaleaxis.accessors.scale;

which dies if you take the validator away, because it will state:

d4.js:235 Uncaught TypeError: Cannot read property 'scale' of undefined

Does that make sense? :)

from d4.

heavysixer avatar heavysixer commented on July 20, 2024

Oh it does not work with the most current version of D3 yet. What version of D3 are you using?

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

4.1.1

from d4.

heavysixer avatar heavysixer commented on July 20, 2024

Yeah that is probably it. If you look at the bower.json file you'll see the version of d3 that d4 is currently bound to https://github.com/heavysixer/d4/blob/master/bower.json 3.5.16

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

Ah That worked! Thanks!
Will there be a 4+ work around at one point?

from d4.

heavysixer avatar heavysixer commented on July 20, 2024

yeah i would like to bring it current with the existing version of d3. However, I am not sure what a timeframe for that will look like. I am going to close this issue for now.

from d4.

gerritboogaart avatar gerritboogaart commented on July 20, 2024

Cool! Thanks for your help!

from d4.

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.