Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
50522d1
Extended list of users
simonkwesi Jan 21, 2016
0d9ed3a
Bugfix: Import missing dygraph-utils.js
timeu Feb 8, 2016
d97bf72
Merge pull request #725 from timeu/patch-2
danvk Feb 8, 2016
3b19616
Merge pull request #715 from simonkwesi/patch-1
danvk Feb 8, 2016
6813609
Update gallery.css
Feb 26, 2016
f1d5ee3
Fix yRangePad for logscale graphs, add tests.
klausw Mar 1, 2016
48c03d4
Merge pull request #729 from danvk/chart-overlaps
Mar 2, 2016
b4b9eea
Merge pull request #732 from klausw/master
danvk Mar 8, 2016
93ec109
Add new issue and PR templates
danvk Mar 16, 2016
7c45116
Merge pull request #736 from danvk/issue-pr-templates
danvk Mar 16, 2016
902091b
Bugfix: Unwanted drawn point when prevCanvasX is 0
mrcslws May 5, 2016
401ff9f
Add unit test to detect the "unwanted draw point"
mrcslws May 5, 2016
287c4d6
Merge pull request #746 from mrcslws/wrong-gap-edge-point
danvk May 12, 2016
b55a71d
Check for new options before updating synchronised graphs (Fixes #760)
justinsg Jul 8, 2016
6eef8c1
Merge pull request #761 from justinsg/master
danvk Jul 11, 2016
bd6ee5d
Implement tick.label_v.
danvk Aug 2, 2016
ad739e0
Demo of label_v
danvk Aug 2, 2016
546df89
Merge pull request #764 from danvk/label_v
danvk Aug 2, 2016
051a854
Bug fix: indexFromSetName on invisible sets (#771)
squaregoldfish Aug 26, 2016
8cc4108
Check that setRow is not negative, fixes #644. (#773)
Sep 12, 2016
2d0fdf6
Dygraph.dateString_: shows milliseconds if any. (#774)
PierrickKoch Sep 15, 2016
f0e4720
Use CSS for styling
danvk Sep 28, 2016
93a5bb4
Use CSS for tests, gallery and docs
danvk Sep 28, 2016
cf61aeb
Merge pull request #678 from danvk/dygraphs-css
danvk Sep 28, 2016
a4094ad
Set x appropriately for series but not point selection (#779)
danvk Sep 29, 2016
f6ec7be
Remove gadget links from tutorial (#780)
danvk Sep 29, 2016
660bb30
Make old-style per-series options throw (#783)
danvk Oct 1, 2016
aec2451
Remove isAndroid checks (#784)
danvk Oct 1, 2016
6ed703f
Only include visible series in range selector (#785)
danvk Oct 1, 2016
36b7208
auto_tests for XHRs (#786)
danvk Oct 1, 2016
0bc4cb5
[Feature Request] Provide option to set color and width for annotatio…
Oct 2, 2016
c76d4b2
Remove some dead data handler coder (#787)
danvk Oct 2, 2016
623dd1d
Fixed attribute name typo in legend follow (#792)
neurot1k Oct 6, 2016
87f78fb
Make resetZoom consistent between x- and y-axes (#812)
danvk Dec 27, 2016
627e054
Import babel polyfill (#813)
danvk Dec 27, 2016
fd6b8da
2.0.0 release fixes (#815)
danvk Dec 28, 2016
6e20721
Fix #816; remove references to valueWindow (#817)
danvk Dec 28, 2016
9154f07
Remove dead code (#818)
danvk Dec 28, 2016
a5f3d82
Add a:visited style to link-interaction (#819)
danvk Dec 29, 2016
87ba46f
Rework the README a bit
danvk Dec 29, 2016
f808e16
revert change to demo.html from 1.1.1
danvk Jan 8, 2017
59ee387
Documentation updates
danvk Jan 11, 2017
0a31d41
Bump to version 2 🎉
danvk Jan 11, 2017
aa0b189
Make dblclick event cancelable. (#840)
danvk Feb 8, 2017
c0e7b62
spelling fixes
Feb 14, 2017
aaec6de
Merge pull request #844 from ka7/feature/spelling
Feb 14, 2017
f160e4a
Fix two inconsistencies in dygraph-externs.js (#859)
drewinglis May 2, 2017
00eebc9
Make setAnnotations' boolean parameter optional. (#851)
kberg May 2, 2017
f6e73ea
Fix gallery navigation from interaction demo (#825)
zemadz May 8, 2017
f18afce
Merge branch 'master' into optiDevelopUpdate
darcyparker May 30, 2017
64f1c4d
Added pixelRatio option to override canvas upscaling. Resolves #876, …
jeffvandyke Sep 20, 2017
c33b49f
Millisecond granularity (#893)
lukevmorris Dec 7, 2017
f598f5e
Bump version to 2.0.1
lukevmorris Dec 7, 2017
8dc4700
Bump version to 2.1.0
lukevmorris Dec 8, 2017
cc2bca6
Remove release.sh, which is now out of date
lukevmorris Dec 12, 2017
ac422b3
Bump versions and add release notes
lukevmorris Dec 12, 2017
61767ef
Make sure that canvasx and canvasy properties are initialized from th…
vii Dec 31, 2017
a2ac6f9
Remove many points from gallery
danvk Dec 31, 2017
6611837
Use link href, not link src (#904)
danvk Jan 30, 2018
da2a028
Clear graph when numAxes goes from 1 -> 2 in updateOptions
neurot1k Oct 6, 2016
27cee3f
Add missing semicolon in externs (#964)
jkuszmaul May 26, 2019
12822e7
Update dygraph.js
lmizinski Feb 17, 2020
06e8ac8
#984 tests for data type detection
Feb 20, 2020
e9155b2
Merge pull request #985 from lmizinski/master
lmizinski Feb 20, 2020
58ae971
Merge branch 'master' into optiDevelopUpdate
darcyparker Mar 4, 2021
0926db2
Add package-lock.json
darcyparker Mar 4, 2021
7584931
Add src-es5 to gitignore
darcyparker Mar 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ It also helps if you include the non-compacted version of the JS on your
page. For instance, instead of doing this:

```html
<script type="text/javascript" src="dygraph-combined.js"></script>
<script type="text/javascript" src="dygraph.min.js"></script>
```

do this:

```html
<script type="text/javascript" src="dygraph-combined.dev.js"></script>
<script type="text/javascript" src="dygraph.js"></script>
```

This makes error messages and debugging simpler. The jsfiddle does this automatically.
Expand Down
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Filing a bug report? Please include the following:

1. Link to a page which demonstrates the problem, preferably a jsfiddle (use http://dygraphs.com/fiddle as a template)
2. Browser and Operating System that exhibit the problem
3. Version of dygraphs that you're using

It also helps if you include the non-compacted version of the JS on your
page. For instance, instead of doing this:

```html
<script type="text/javascript" src="dygraph.min.js"></script>
```

do this:

```html
<script type="text/javascript" src="dygraph.js"></script>
```

This makes error messages and debugging simpler. The jsfiddle does this automatically.
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Please read the guide to making dygraphs changes:
http://dygraphs.com/changes.html

Pull Requests will only be accepted if:

- You clearly explain what you're adding and why you believe it's an
improvement. For example: "Fixes issue #123".
- You adhere to the style of the rest of the dygraphs code base.
- You write an `auto_test` for the code that you're adding.

Be sure to document any new options you add. Also be aware that PRs which add
options are likely to be rejected. dygraphs already has many options. If you
can fit your feature into one of those or implement it as a plugin, it will be
more likely to get merged.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ env
dist
coverage
*.log
*.pyc
src-es5
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.10"
- "6"

sudo: false # Use container-based architecture
script: >
Expand Down
4 changes: 4 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This is a step-by-step guide explaining how to do it.

### How-to

To install dependencies, run

npm install

To build dygraphs, run

npm run build
Expand Down
57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ The dygraphs JavaScript library produces interactive, zoomable charts of time se

Learn more about it at [dygraphs.com](http://www.dygraphs.com).

Get help with dygraphs on
[Stack Overflow](http://stackoverflow.com/questions/tagged/dygraphs) (preferred) and
[Google Groups](http://groups.google.com/group/dygraphs-users)
Get help with dygraphs by browsing the on [Stack Overflow][] (preferred) and [Google Groups][].

## Features
* Plots time series without using an external server or Flash
* Supports [error bands](http://dygraphs.com/tests/legend-values.html) around data series
* Interactive [pan and zoom](http://dygraphs.com/tests/link-interaction.html)
* Displays values [on mouseover](http://dygraphs.com/tests/legend-values.html)
* Adjustable [averaging period](http://dygraphs.com/tests/temperature-sf-ny.html)
* Extensive set of [options](http://www.dygraphs.com/options.html) for customization.
* Compatible with the [Google Visualization API](http://dygraphs.com/data.html#datatable)
* Supports [error bands][] around data series
* Interactive [pan and zoom][]
* Displays values [on mouseover][]
* Adjustable [averaging period][]
* Extensive set of [options][] for customization.
* Compatible with the [Google Visualization API][gviz]

## Minimal Example
```html
<html>
<head>
<script type="text/javascript" src="dygraph-combined.js"></script>
<script type="text/javascript" src="dygraph.js"></script>
<link rel="stylesheet" href="dygraph.css" />
</head>
<body>
<div id="graphdiv"></div>
Expand All @@ -42,9 +41,27 @@ Get help with dygraphs on
</html>
```

Learn more by reading [the tutorial](http://www.dygraphs.com/tutorial.html) and
seeing demonstrations of what dygraphs can do in the
[gallery](http://www.dygraphs.com/gallery).
Learn more by reading [the tutorial][] and seeing demonstrations of what
dygraphs can do in the [gallery][]. You can get `dygraph.js` and `dygraph.css`
from [cdnjs][] or [from NPM][npm] (see below).

## Usage with a module loader

Get dygraphs from NPM:

npm install dygraphs

You'll find pre-built JS & CSS files in `node_modules/dygraphs/dist`. If you're
using a module bundler like browserify or webpack, you can import dygraphs:

```js
import Dygraph from 'dygraphs';
// or: const Dygraph = require('dygraphs');

const g = new Dygraph('graphdiv', data, { /* options */ });
```

Check out the [dygraphs-es6 repo][] for a fully-worked example.

## Development

Expand All @@ -59,3 +76,17 @@ Read more about the dygraphs development process in the [developer guide](/DEVEL

## License(s)
dygraphs is available under the MIT license, included in LICENSE.txt.

[cdnjs]: https://cdnjs.com/libraries/dygraph
[the tutorial]: http://www.dygraphs.com/tutorial.html
[gallery]: http://www.dygraphs.com/gallery
[error bands]: http://dygraphs.com/tests/legend-values.html
[pan and zoom]: http://dygraphs.com/tests/link-interaction.html
[on mouseover]: http://dygraphs.com/tests/legend-values.html
[averaging period]: http://dygraphs.com/tests/temperature-sf-ny.html
[options]: http://www.dygraphs.com/options.html
[Stack Overflow]: http://stackoverflow.com/questions/tagged/dygraphs?sort=votes&pageSize=50
[Google Groups]: http://groups.google.com/group/dygraphs-users
[gviz]: http://dygraphs.com/data.html#datatable
[npm]: https://www.npmjs.com/package/dygraphs
[dygraphs-es6 repo]: https://github.com/danvk/dygraphs-es6
4 changes: 1 addition & 3 deletions auto_tests/coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<meta charset="utf-8">
<title>dygraphs tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="../css/dygraph.css" />
</head>
<body>
<div id="graph"></div>
<div id="mocha"></div>

<!-- Polyfills for PhantomJS -->
<script src="../node_modules/babel-core/browser-polyfill.js"></script>

<!-- Mocha -->
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
Expand Down
9 changes: 9 additions & 0 deletions auto_tests/data/out-of-order-dates.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Date,r17,r82,r83,r9
2013-10-17T21:00:00Z,,,,9
2014-05-29T18:00:00Z,,,,9
2013-10-17T21:00:00Z,17,,,
2014-05-29T17:00:00Z,17,,,
2014-05-29T18:00:00Z,,82,,
2014-05-29T18:00:00Z,,,83,
2014-10-11T04:00:00Z,,,83,
2015-05-22T04:00:00Z,,82,,
5 changes: 5 additions & 0 deletions auto_tests/data/out-of-order.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
X,Y1,Y2
0,0,0
1,1,1
3,3,9
2,2,4
5 changes: 5 additions & 0 deletions auto_tests/data/sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
X,Y1,Y2
0,0,0
1,1,1
2,2,4
3,3,9
4 changes: 1 addition & 3 deletions auto_tests/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<meta charset="utf-8">
<title>dygraphs tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="../css/dygraph.css" />
</head>
<body>
<div id="graph"></div>
<div id="mocha"></div>

<!-- Polyfills for PhantomJS -->
<script src="../node_modules/babel-core/browser-polyfill.js"></script>

<!-- Mocha -->
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
Expand Down
96 changes: 27 additions & 69 deletions auto_tests/tests/axis_labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,33 @@ it('testLogScale', function() {
assert.deepEqual(['0','200','400','600','800','1000'], Util.getYLabels());
});

/**
* Verify that log scale axis range works with yRangePad.
*
* This is a regression test for https://github.com/danvk/dygraphs/issues/661 .
*/
it('testLogScalePad', function() {
var g = new Dygraph("graph",
[[0, 1e-5], [1, 0.25], [2, 1], [3, 3], [4, 10]], {
width: 250,
height: 130,
logscale: true,
yRangePad: 30,
axes: {y: {valueRange: [1, 10]}},
labels: ['X', 'Y']
});
var nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; });
assert.deepEqual(['1', '7', '30'], nonEmptyLabels);

g.updateOptions({ yRangePad: 10, axes: {y: {valueRange: [0.25005, 3]}} });
nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; });
assert.deepEqual(['0.4', '1', '3'], nonEmptyLabels);

g.updateOptions({ axes: {y: {valueRange: [0.01, 3]}} });
nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; });
assert.deepEqual(['0.01','0.1','0.7','5'], nonEmptyLabels);
});

/**
* Verify that include zero range is properly specified.
*/
Expand Down Expand Up @@ -771,75 +798,6 @@ it('testAxisLabelFontSizeNull', function() {
assertFontSize(document.querySelectorAll(".dygraph-axis-label-y"), "14px");
});

it('testAxisLabelColor', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData, {});

// Be sure we're dealing with a black default.
assert.equal("black", DEFAULT_ATTRS.axisLabelColor);

var assertColor = function(selector, expected) {
Util.assertStyleOfChildren(selector, "color", expected);
}

assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(0, 0, 0)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y"), "rgb(0, 0, 0)");

g.updateOptions({ axisLabelColor : "red"});
assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(255, 0, 0)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y"), "rgb(255, 0, 0)");

g.updateOptions({
axisLabelColor : null,
axes : {
x : { axisLabelColor : "blue" },
}
});

assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(0, 0, 255)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y"), "rgb(0, 0, 0)");

g.updateOptions({
axes : {
y : { axisLabelColor : "green" },
}
});

assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(0, 0, 255)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y"), "rgb(0, 128, 0)");

g.updateOptions({
series : {
Y2 : { axis : "y2" } // copy y2 series to y2 axis.
},
axes : {
y2 : { axisLabelColor : "yellow" },
}
});

assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(0, 0, 255)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y1"), "rgb(0, 128, 0)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y2"), "rgb(255, 255, 0)");
});

it('testAxisLabelColorNull', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData,
{
axisLabelColor: null
});

var assertColor = function(selector, expected) {
Util.assertStyleOfChildren(selector, "color", expected);
}

// Be sure we're dealing with a 14-point default.
assert.equal(14, DEFAULT_ATTRS.axisLabelFontSize);

assertColor(document.querySelectorAll(".dygraph-axis-label-x"), "rgb(0, 0, 0)");
assertColor(document.querySelectorAll(".dygraph-axis-label-y"), "rgb(0, 0, 0)");
});

/*
* This test shows that the label formatter overrides labelsKMB for all values.
*/
Expand Down
18 changes: 18 additions & 0 deletions auto_tests/tests/data_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @author danvdk@gmail.com (Dan Vanderkam)
*/
import Dygraph from '../../src/dygraph';
import * as utils from '../../src/dygraph-utils';
describe("data-api", function() {

cleanupAfterEach();
Expand Down Expand Up @@ -99,4 +100,21 @@ it('testGetRowForXDuplicates', function() {
assert.equal(5, g.getRowForX(9));
});

// indexFromSeriesName should return a value even if the series is invisible
// In 1.1.1, if you request the last set and it's invisible, the method returns undefined.
it('testIndexFromSetNameOnInvisibleSet', function() {

var localOpts = utils.clone(opts);
localOpts.visibility = [true, false];

var g = new Dygraph(graphDiv, [
"x,y1,y2",
"1,1,1",
"2,2,2",
"3,3,3"
].join('\n'), localOpts);

assert.equal(2, g.indexFromSetName("y2"));
});

});
34 changes: 34 additions & 0 deletions auto_tests/tests/data_types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @fileoverview Test cases for DygraphOptions.
*/

import Dygraph from '../../src/dygraph';

describe("dygraph-data-types", function() {

cleanupAfterEach();

var graph;

beforeEach(function() {
graph = document.getElementById("graph");
});

/*
* Test to ensure ints are correctly interpreted as ints and not as dates
*/
it('testNumberOfData', function() {
var opts = {
width: 480,
height: 320
};
var data = "x y\n" +
"20033000 1\n" +
"20034000 2\n" +
"20035000 3\n" +
"20036000 4";

var g = new Dygraph(graph, data, opts);
assert.deepEqual(4, g.rawData_.length);
});
});
Loading