GithubHelp home page GithubHelp logo

d3.chart.base's People

Contributors

iros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

d3.chart.base's Issues

_attrs - private?

Hi! Just a quick question.

I noticed here all the attributes had an underscore in front (_width), whereas in the introduction, some had an underscore, but the xScale didn't.

Could you explain this pattern? I thought underscores typically represented private attributes.

Understanding _initAttr

I'm trying to understand the initAttr function:

  function _initAttr(internalName, d3Name, defaultValue) {
    if (!this.base.attr(d3Name)) {
      this[internalName] = defaultValue;
      this.base.attr(d3Name, defaultValue);
    } else {
      this[internalName] = this.base.attr(d3Name);
    }
  }

It seems like after you use it

    // make sure container height and width are set.
    _initAttr.call(this, "_width", "width", 200);
    _initAttr.call(this, "_height", "height", 200);

these lines become unnecessary:

 // setup some reasonable defaults
    chart._width  = chart.base.attr("width") || 200;
    chart._height = chart.base.attr("height") || 200;

since in either case (svg width/height are already set, or they're not) the initAttr function is assigning a value to this._width and this._height. What am I missing?

Margins

Do you think margins have a place in a base chart such as this one? How have you implemented margins in your work with d3.chart so far?

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.