Skip to content

Commit

Permalink
Version 1.6.1: Fix for animationDuration and Delay
Browse files Browse the repository at this point in the history
  • Loading branch information
derpylz committed Apr 2, 2022
1 parent 9984ff4 commit 48ab985
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion dist/babyplots.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/babyplots.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/examples/semantleExample.js

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>babyplots example</title>
<script src="dist/CCapture.all.min.js"></script>
<script src="dist/examples/surface.js"></script>
<script src="dist/examples/heatMap.js"></script>
<script src="dist/examples/pointCloud.js"></script>
<script src="dist/examples/pointCloud_sm.js"></script>
<script src="dist/examples/shapeCloud.js"></script>
<script src="dist/examples/shapeCloudInfo.js"></script>
<script src="dist/examples/imagestack.js"></script>
<!-- <script src="dist/examples/surface.js"></script> -->
<!-- <script src="dist/examples/heatMap.js"></script> -->
<!-- <script src="dist/examples/pointCloud.js"></script> -->
<script src="dist/examples/semantleExample.js"></script>
<!-- <script src="dist/examples/shapeCloud.js"></script> -->
<!-- <script src="dist/examples/shapeCloudInfo.js"></script> -->
<!-- <script src="dist/examples/imagestack.js"></script> -->
<script src="dist/babyplots.js"></script>
<style>
html,
Expand Down Expand Up @@ -254,25 +254,25 @@
// vis.camera.radius = 800;
// vis.camera.alpha = 0;
// vis.camera.beta = 1;
vis.addPlot([
[6.671802, -4.664322, 4.977584],
[6.397511, -5.695337, 5.750157],
[6.834549, -4.452236, 5.134693],
[5.876275, -6.303131, 4.273763],
[5.795466, -6.470013, 4.276352]
], "line", "values", [
0.285020,
0.317455,
0.417574,
0.602124,
1
], {
labels: ["cannon", "man", "rifle", "shoot", "shot"],
labelColor: "match",
labelSize: 50,
hasAnimation: true
})
vis.fromJSON(pointCloudSmData);
// vis.addPlot([
// [6.671802, -4.664322, 4.977584],
// [6.397511, -5.695337, 5.750157],
// [6.834549, -4.452236, 5.134693],
// [5.876275, -6.303131, 4.273763],
// [5.795466, -6.470013, 4.276352]
// ], "line", "values", [
// 0.285020,
// 0.317455,
// 0.417574,
// 0.602124,
// 1
// ], {
// labels: ["cannon", "man", "rifle", "shoot", "shot"],
// labelColor: "match",
// labelSize: 50,
// hasAnimation: true
// })
vis.fromJSON(semantleExampleData);
vis.doRender();
vis.createButtons(["turntable", "json", "label"]);
window.onresize = function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babyplots",
"version": "1.6.0",
"version": "1.6.1",
"description": "Easy interactive 3d plots.",
"main": "build/babyplots.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions src/plotTypes/Line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ export class Line extends CoordinatePlot {
) {
super(name, "line", scene, coordinates, colorVar, size, legendData, xScale, yScale, zScale);
this._hasAnimation = hasAnimation;
this._animationDelay = this._animationDelay ?? animationDelay;
this._animationFrames = this._animationFrames ?? animationDuration;
if (animationDelay) {
this._animationDelay = animationDelay;
}
if (animationDuration) {
this._animationFrames = animationDuration;
}
if (labels && labels.length === coordinates.length && annotationManager) {
this.labels = labels;
this.labelSize = labelSize;
Expand Down

0 comments on commit 48ab985

Please sign in to comment.