Skip to content

Commit 0b05ac5

Browse files
author
Daniel W Mane
committed
Merge pull request #118 from palantir/dev
Merge 0.1.4 into master
2 parents dae7f97 + 742061c commit 0b05ac5

13 files changed

Lines changed: 108 additions & 28 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
Plottable.js
22
============
33

4-
Plottable.js is a library for easily creating beautiful, flexible, interactive, and performant charts for the web. It is built on top of d3 and provides a higher level of abstraction: the developer does not need to worry about d3's low-level components and can easily access many chart renderers, interaction patterns, and a flexible layout engine. Plottable.js is being developed by Palantir Technologies, and is written in TypeScript.
4+
Plottable.js is a library for easily creating flexible, interactive, and performant charts for the web. It is built on top of d3 and provides a higher level of abstraction.
55

6-
Plottable.js is currently in early alpha and does not yet have a stable API.
6+
Plottable consists of three main pieces:
7+
- A grid-based layout engine which handles positioning, sizing, and alignment of components
8+
- "Components", such as LineRenderer or Axis, which process data and can be connected to d3 Scales
9+
- "Interactions", such as PanZoomInteraction or AreaInteraction, which easily allow for custom logic to be bound to common interaction patterns
710

11+
By virtue of being higher-level than D3, it is often much easier to create charts in Plottable.js, with less of a learning curve. Stylistic changes that would be a pain in D3 (e.g. changing font sizes) are trivially easy in Plottable.js (change the CSS and everything updates). On the other hand, if you want the full power and expressivity of D3, you can just write a new Component plugin in D3, and still get all of the benefits of Plottable's layout engine and other components.
12+
13+
Plottable.js is being developed by Palantir Technologies. It's developed in Typescript, and released in Javascript. Plottable is currently in alpha and the API is not yet stable.
814

915
=========
1016
Setup Instructions:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plottable.js",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"dependencies": {
55
"d3": "3.4.1"
66
},

examples/demo.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ module Demo {
5353
var yScale = new LinearScale();
5454
var rightAxes = [new YAxis(yScale, "right"), new YAxis(yScale, "right")];
5555
var rightAxesTable = new Table([rightAxes]);
56-
rightAxesTable.colWeight(0);
5756
var xAxis = new XAxis(xScale, "bottom");
5857
var data = makeRandomData(30);
5958
var renderArea = new LineRenderer(data, xScale, yScale);
@@ -75,10 +74,8 @@ module Demo {
7574
var yScale1 = new LinearScale();
7675
var leftAxes = [new YAxis(yScale1, "left"), new YAxis(yScale1, "left")];
7776
var leftAxesTable = new Table([leftAxes]);
78-
leftAxesTable.colWeight(0);
7977
var rightAxes = [new YAxis(yScale1, "right"), new YAxis(yScale1, "right")];
8078
var rightAxesTable = new Table([rightAxes]);
81-
rightAxesTable.colWeight(0);
8279
var data1 = makeRandomData(30, .0005);
8380
var renderer1 = new LineRenderer(data1, xScale1, yScale1);
8481
var row1: Component[] = [leftAxesTable, renderer1, rightAxesTable];
@@ -131,12 +128,10 @@ module Demo {
131128
var yAxisRight = new YAxis(yScale, "right");
132129
var yAxisRightLabel = new AxisLabel("bp y right qd", "vertical-right");
133130
var yAxisRightTable = new Table([[yAxisRight, yAxisRightLabel]]);
134-
yAxisRightTable.colWeight(0);
135131

136132
var yAxisLeft = new YAxis(yScale, "left");
137133
var yAxisLeftLabel = new AxisLabel("bp y left qd", "vertical-left");
138134
var yAxisLeftTable = new Table([[yAxisLeftLabel, yAxisLeft]]);
139-
yAxisLeftTable.colWeight(0);
140135

141136
var data = makeRandomData(30);
142137
var renderArea = new LineRenderer(data, xScale, yScale);

examples/demoDay.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ module DemoDay {
88
s.yScale = new LinearScale();
99
s.leftAxis = new YAxis(s.yScale, "left");
1010
var leftAxisTable = new Table([[new AxisLabel("y", "vertical-left"), s.leftAxis]]);
11-
leftAxisTable.colWeight(0);
1211
s.xAxis = new XAxis(s.xScale, "bottom");
1312
var xAxisTable = new Table([[s.xAxis], [new AxisLabel("x")]]);
14-
xAxisTable.rowWeight(0);
1513

1614
s.renderer = new CircleRenderer(data, s.xScale, s.yScale, null, null, 1.5);
1715
s.xSpark = new LinearScale();
@@ -37,9 +35,7 @@ module DemoDay {
3735
h.xAxis1 = new XAxis(h.xScale1, "bottom");
3836
h.yAxis1 = new YAxis(h.yScale1, "right");
3937
var labelX1Table = new Table([[h.xAxis1], [new AxisLabel("X values")]]);
40-
labelX1Table.rowWeight(0);
4138
var labelY1Table = new Table([[h.yAxis1, new AxisLabel("Counts", "vertical-right")]]);
42-
labelY1Table.colWeight(0);
4339
var table1 = new Table([[h.renderer1, labelY1Table], [labelX1Table, null]]);
4440

4541
var yExtent = d3.extent(data, (d) => d.y);
@@ -52,9 +48,7 @@ module DemoDay {
5248
h.xAxis2 = new XAxis(h.xScale2, "bottom");
5349
h.yAxis2 = new YAxis(h.yScale2, "right");
5450
var labelX2Table = new Table([[h.xAxis2], [new AxisLabel("Y values")]]);
55-
labelX2Table.rowWeight(0);
5651
var labelY2Table = new Table([[h.yAxis2, new AxisLabel("Counts", "vertical-right")]]);
57-
labelY2Table.colWeight(0);
5852
var table2 = new Table([[h.renderer2, labelY2Table], [labelX2Table, null]]);
5953

6054
h.table = new Table([[table1], [table2]]);

examples/simpleChart/demo.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
.demo-title { font-size: 24pt; }
3+
.quadratic-series circle {
4+
fill: red;
5+
}

examples/simpleChart/demo.details

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Plottable.js Simple Chart Demo
3+
description: Creates a chart with an x-axis, y-axis, and circle renderer
4+
authors:
5+
- Justin Lan
6+
normalize_css: no
7+
...

examples/simpleChart/demo.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
2+
<script src="http://palantir.github.io/plottable/plottable.js"></script>
3+
<link rel="stylesheet" type="text/css" href="http://palantir.github.io/plottable/style.css">
4+
5+
<div class="demo-title">Simple Chart</div>
6+
<br>
7+
<svg id="simple-chart"></svg>

examples/simpleChart/demo.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
window.onload = function() {
2+
function makeQuadraticSeries(numPoints) {
3+
var data = [];
4+
for (var i = 0; i< numPoints; i++) {
5+
data.push({x: i, y: i*i});
6+
}
7+
return {data: data, seriesName: "quadratic-series"};
8+
}
9+
10+
var dataseries = makeQuadraticSeries(20);
11+
12+
var svg = d3.select("#simple-chart");
13+
svg.attr("width", 480).attr("height", 320);
14+
var xScale = new LinearScale();
15+
var yScale = new LinearScale();
16+
var xAxis = new XAxis(xScale, "bottom");
17+
var yAxis = new YAxis(yScale, "left");
18+
var renderAreaD1 = new CircleRenderer(dataseries, xScale, yScale);
19+
var basicTable = new Table([[yAxis, renderAreaD1],
20+
[null, xAxis]]);
21+
basicTable.anchor(svg).computeLayout().render();
22+
};

license_header.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
Plottable v0.1.3 (https://github.com/palantir/plottable)
2+
Plottable v0.1.4 (https://github.com/palantir/plottable)
33
Copyright 2014 Palantir Technologies
44
Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE)
55
*/

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plottable.js",
3-
"version": "0.1.3",
4-
"description": "A library for easily creating charts within a grid layout.",
3+
"version": "0.1.4",
4+
"description": "Build flexible, performant, interactive charts using D3",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/palantir/plottable.git"

0 commit comments

Comments
 (0)