-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5d76e7
commit dab662c
Showing
6 changed files
with
1,584 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,6 @@ kino_vega_lite-*.tar | |
|
||
# Temporary files, for example, from tests. | ||
/tmp/ | ||
|
||
# Node modules. | ||
assets/*/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import "https://cdn.jsdelivr.net/npm/[email protected]"; | ||
import "https://cdn.jsdelivr.net/npm/[email protected]"; | ||
import "https://cdn.jsdelivr.net/npm/[email protected]"; | ||
import vegaEmbed from "vega-embed"; | ||
import { changeset } from "vega"; | ||
|
||
// See https://github.com/vega/vega-lite/blob/b61b13c2cbd4ecde0448544aff6cdaea721fd22a/src/compile/data/assemble.ts#L228-L231 | ||
const DEFAULT_DATASET_NAME = "source_0"; | ||
|
@@ -167,16 +166,16 @@ export function init(ctx, data) { | |
|
||
function buildChangeset(currentData, newData, window) { | ||
if (window === 0) { | ||
return vega.changeset().remove(currentData); | ||
return changeset().remove(currentData); | ||
} else if (window) { | ||
const toInsert = newData.slice(-window); | ||
const freeSpace = Math.max(window - toInsert.length, 0); | ||
const toRemove = | ||
freeSpace === 0 ? currentData : currentData.slice(0, -freeSpace); | ||
|
||
return vega.changeset().remove(toRemove).insert(toInsert); | ||
return changeset().remove(toRemove).insert(toInsert); | ||
} else { | ||
return vega.changeset().insert(newData); | ||
return changeset().insert(newData); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.