Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 2ddda52

Browse files
committed
2 parents 9d90dc7 + bc36a38 commit 2ddda52

4 files changed

Lines changed: 148 additions & 19 deletions

File tree

RELEASE_NOTES.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
### 1.5.15 (December , 2018)
2+
3+
New features:
4+
- added a new sample of figure with axes, grid and navigation
5+
- added support for the figure's data-idd-navigation-enabled and data-idd-legend-enabled attributes.
6+
17
### 1.5.14 (August 16, 2018)
28

39
Bug fixes:
4-
- Fixed multiple event subscription to the zoom event
10+
- fixed multiple event subscription to the zoom event.
511

612
### 1.5.13 (August 9, 2018)
713

@@ -11,22 +17,22 @@ Bug fixes:
1117
### 1.5.12 (June 14, 2018)
1218

1319
Bug fixed:
14-
- iddXAxisSettings, iddYAxisSettings added
20+
- iddXAxisSettings, iddYAxisSettings added.
1521

1622
### 1.5.11 (May 31, 2018)
1723

1824
Bug fixed:
19-
- bounding box for Bars is now calculated in plot coordinates
25+
- bounding box for Bars is now calculated in plot coordinates.
2026

2127
### 1.5.10 (May 29, 2018)
2228

2329
Bug fixed:
24-
- iddBarWidth binding for markers works with plot coordinates now
30+
- iddBarWidth binding for markers works with plot coordinates now.
2531

2632
### 1.5.9 (May 21, 2018)
2733

2834
Bug fixed:
29-
- plot.order can now be assigned either externally (e.g. via binding) or by relevant legend item reordering (in Chart Viewer)
35+
- plot.order can now be assigned either externally (e.g. via binding) or by relevant legend item reordering (in Chart Viewer).
3036

3137
### 1.5.8 (May 18, 2018)
3238

@@ -36,16 +42,16 @@ Bug fixed:
3642
### 1.5.7 (May 15, 2018)
3743

3844
New features:
39-
- added custom KO binding: iddPlotOrder - integer value that controls the plot order.
40-
- added sample page KO.Order.html for the iddPlotOrder binding.
41-
- added custom KO bindings: iddXlog, iddYlog. They boolean value of them controls the log transform of corresponding axis.
45+
- added custom KO binding: iddPlotOrder - integer value that controls the plot order
46+
- added sample page KO.Order.html for the iddPlotOrder binding
47+
- added custom KO bindings: iddXlog, iddYlog. They boolean value of them controls the log transform of corresponding axis
4248
- added custom KO bindings: iddIgnoredByFitToView. if set to true, the plot is excluded from FitToView visible region calculation.
4349

4450
### 1.5.6 (May 11, 2018)
4551

4652
New features:
47-
- plot now has `isIgnoredByFitToView` property. Setting it to `true` prevents the plot to be accounted during FitToView visible region recalculation.
48-
- new sample page: order property of the plot is changed by slider
53+
- plot now has `isIgnoredByFitToView` property. Setting it to `true` prevents the plot to be accounted during FitToView visible region recalculation
54+
- new sample page: order property of the plot is changed by slider.
4955

5056
### 1.5.5 (May 10, 2018)
5157

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "interactive-data-display",
3-
"version": "1.5.14",
3+
"version": "1.5.15",
44
"license": "Apache-2.0",
55
"homepage": "https://github.com/predictionmachines/InteractiveDataDisplay/wiki",
66
"description": "A JavaScript visualization library for dynamic data",

samples/PolylineInFigure.html

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="X-UA-Compatible" content="IE=10; IE=Edge" />
5+
<title>Polyline by Figure</title>
6+
<link rel="stylesheet" type="text/css" href="../dist/idd.css" />
7+
<link rel="stylesheet" type="text/css" href="../src/css/IDDTheme.css" />
8+
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
10+
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
11+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/3.1.2/rx.lite.min.js"></script>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.4.0/svg.js"></script>
14+
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.js"></script>
15+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
16+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
17+
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.1/knockout-min.js"></script>
18+
<script src="../dist/idd_knockout.js"></script>
19+
20+
<script type="text/javascript">
21+
$(document).ready(function () {
22+
var plot1 = InteractiveDataDisplay.asPlot($("#figure1"));
23+
var plot2 = InteractiveDataDisplay.asPlot($("#figure2"));
24+
var plot3 = InteractiveDataDisplay.asPlot($("#figure3"));
25+
});
26+
</script>
27+
</head>
28+
29+
<body>
30+
<div style="display: inline-grid">
31+
32+
<b>Axes, grid lines and legend</b>
33+
<div id="figure1" data-idd-plot="figure" style="width: 400px; height: 300px; float:left"
34+
data-idd-navigation-enabled="true" data-idd-legend-enabled="true">
35+
36+
<div id="grid1" data-idd-plot='grid' data-idd-placement='center' data-idd-style='stroke: DarkGray; thickness: 1px;'
37+
data-idd-xaxis='bottom_axis1' data-idd-yaxis='left_axis1'></div>
38+
39+
<div data-idd-plot="polyline" data-idd-style="stroke: red; thickness: 3" id="red line">
40+
x y
41+
0 0
42+
1 1
43+
2 2
44+
</div>
45+
<div data-idd-plot="polyline" data-idd-style="stroke: green; thickness: 3" id="green line">
46+
x y
47+
0 1
48+
1 0
49+
2 2
50+
</div>
51+
52+
<div id="bottom_axis1" data-idd-axis="numeric" data-idd-placement="bottom" style="position: relative;"></div>
53+
<div id="left_axis1" data-idd-axis="numeric" data-idd-placement="left" style="position: relative;"></div>
54+
</div>
55+
56+
<b>Bottom axis and grid lines</b>
57+
<div id="figure2" data-idd-plot="figure" style="width: 400px; height: 300px; float:left"
58+
data-idd-navigation-enabled="true" data-idd-legend-enabled="false">
59+
60+
<div id="grid2" data-idd-plot='grid' data-idd-placement='center' data-idd-style='stroke: DarkGray; thickness: 1px;'
61+
data-idd-xaxis='bottom_axis2'></div>
62+
63+
<div data-idd-plot="polyline" data-idd-style="stroke: blue; thickness: 3">
64+
x y
65+
0 2
66+
1 1
67+
2 0
68+
</div>
69+
70+
<div id="bottom_axis2" data-idd-axis="numeric" data-idd-placement="bottom" style="position: relative;"></div>
71+
</div>
72+
73+
<b>Axes</b>
74+
<div id="figure3" data-idd-plot="figure" style="width: 400px; height: 300px; float:left"
75+
data-idd-navigation-enabled="true">
76+
77+
<div data-idd-plot="polyline" data-idd-style="stroke: yellow; thickness: 3">
78+
x y
79+
0 1
80+
1 2
81+
2 0
82+
</div>
83+
84+
<div id="bottom_axis3" data-idd-axis="numeric" data-idd-placement="bottom" style="position: relative;"></div>
85+
<div id="left_axis3" data-idd-axis="numeric" data-idd-placement="left" style="position: relative;"></div>
86+
</div>
87+
</div>
88+
89+
90+
</body>
91+
</html>

src/idd/idd.figure.js

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,7 @@ InteractiveDataDisplay.Figure = function (div, master) {
5757
var topChildren = [];
5858
var rightChildren = [];
5959

60-
var addRelativeDiv = function (jqdiv, params, insertBeforeDiv) {
61-
var packDiv = $("<div></div>");
62-
packDiv.appendTo(that.host).addClass("idd-figure-container");
63-
packDiv.content = jqdiv;
64-
jqdiv.appendTo(packDiv);
65-
66-
var placement = jqdiv.attr("data-idd-placement");
67-
60+
var initAxis = function (jqdiv, params) {
6861
if (jqdiv.attr("data-idd-axis")) {
6962
var axis = InteractiveDataDisplay.InitializeAxis(jqdiv, params);
7063
jqdiv.axis = axis;
@@ -73,6 +66,15 @@ InteractiveDataDisplay.Figure = function (div, master) {
7366
else that.master.fitToViewY();
7467
});
7568
}
69+
}
70+
71+
var addRelativeDiv = function (jqdiv, params, insertBeforeDiv) {
72+
var packDiv = $("<div></div>");
73+
packDiv.appendTo(that.host).addClass("idd-figure-container");
74+
packDiv.content = jqdiv;
75+
jqdiv.appendTo(packDiv);
76+
77+
var placement = jqdiv.attr("data-idd-placement");
7678

7779
var addDiv = function (packs) {
7880
if (insertBeforeDiv) {
@@ -165,6 +167,7 @@ InteractiveDataDisplay.Figure = function (div, master) {
165167
//packing element to figure containers in figure packs
166168
if (checkElementPosition(jqdiv)) {
167169
addRelativeDiv(jqdiv);
170+
initAxis(jqdiv);
168171
}
169172
});
170173

@@ -689,6 +692,35 @@ InteractiveDataDisplay.Figure = function (div, master) {
689692
};
690693

691694
this.requestUpdateLayout();
695+
696+
if(div.attr("data-idd-navigation-enabled") === "true"){
697+
var gestureSource = InteractiveDataDisplay.Gestures.getGesturesStream(this.centralPart);
698+
this.navigation.gestureSource = gestureSource;
699+
}
700+
701+
if(div.attr("data-idd-legend-enabled") === "true"){
702+
var legendDiv = $("<div></div>").prependTo(this.centralPart);
703+
var _legend = new InteractiveDataDisplay.Legend(this, legendDiv, true);
704+
legendDiv.css("float", "right");
705+
Object.defineProperty(this, "legend", { get: function () { return _legend; }, configurable: false });
706+
707+
//Stop event propagation
708+
InteractiveDataDisplay.Gestures.FullEventList.forEach(function (eventName) {
709+
legendDiv[0].addEventListener(eventName, function (e) {
710+
e.stopPropagation();
711+
}, false);
712+
});
713+
714+
var data = {};
715+
InteractiveDataDisplay.Utils.readStyle(div, data);
716+
var visible = data.isLegendVisible;
717+
if (visible) {
718+
if (visible == "true")
719+
_legend.isVisible = true;
720+
else if (visible == "false")
721+
_legend.isVisible = false;
722+
}
723+
}
692724
}
693725

694726
InteractiveDataDisplay.Figure.prototype = new InteractiveDataDisplay.Plot;

0 commit comments

Comments
 (0)