Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart Axis Modularization #373

Merged
merged 129 commits into from
Jan 14, 2013
Merged

Chart Axis Modularization #373

merged 129 commits into from
Jan 14, 2013

Conversation

tripp
Copy link
Contributor

@tripp tripp commented Dec 21, 2012

This is a refactoring of the chart's axis layer so that it is more modular. In this update, I've broken up the charts module into several smaller modules that can be downloaded as needed to build custom chart applications. For example, the below code snippet will only pull down code necessary to build a sparkline.

YUI().use('axis-numeric-base', 'axis-time-base', 'series-line', function (Y) {
    var myDataValues = [
        {date: "01/01/2009", open: 90.27, close: 170.27},
        {date: "01/02/2009", open: 91.55, close: 8.55},
        ...
    ],
    categoryAxis = new Y.TimeAxisBase({
        dataProvider: myDataValues,
        keys: ["date"]
    }),
    seriesAxis = new Y.NumericAxisBase({
        dataProvider: myDataValues,
        keys: ["close"]
    }),
    graphic = new Y.Graphic({
        render: "#mychart"
    }),
    series = new Y.LineSeries({
        graphic: graphic,
        xAxis: categoryAxis,
        xKey: "date",
        yAxis: seriesAxis,
        yKey: "close",
        rendered: true,
        styles: {
            line: {
                weight: 1
            }
        }
    });
    series.draw();
});

Despite the many diffs in this commit, there is not much actual code change. The vast bulk of diffs are API Doc updates so that one can view the propose breakout of charts modules by running yogi serve. Some diffs are due to code being moved into new classes for modularity. This is a work in progress (for this sprint) and the pull request is for the benefit of broadcasting the upcoming changes.

While any feedback is always welcome, the emphasis of this request is on the classes outlined in the attached diagrams and the new modules.

ORIGINAL AXIS CLASSES

original

UPDATED AXIS CLASSES

modularized

Also important are:
src/charts/build.json
src/charts/meta/*

Additionally, you can run yogi serve on the charts directory and click the API Docs link to get a good view of the modules.

The 'charts' and 'charts-legend' modules will have the same functionality as before.

solmsted and others added 30 commits October 10, 2012 01:09
… versions, add native versions, add meta tests, remove old references from polyfills
To be able to test which implementation is being used
…ons/references to the original global variable declaration rather than do it manually.
@davglass
Copy link
Member

davglass commented Jan 8, 2013

I'm not sure why this is broken on Travis, but this builds perfectly fine locally from a clean clone.

@hojberg
Copy link
Contributor

hojberg commented Jan 8, 2013

thats a damn fine pull request description

@davglass
Copy link
Member

👍 Merge it..

@tripp
Copy link
Contributor Author

tripp commented Jan 14, 2013

@davglass
I have yet to merge any changes. I had to remove a dependency on the Y.Graph class from some series types to allow for modular implementation.

@tripp tripp merged commit 90db190 into yui:dev-3.x Jan 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants