Skip to content

Commit

Permalink
vega modifier instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWilmot committed Jun 2, 2022
1 parent 265b771 commit a4ed8f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addon/modifiers/vega.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ export default class VegaModifier extends Modifier<VegaModifierArgs> {

if (!this._vegaView) {
// Create new Vega.View instance
console.log('before createView');
await this._createView(element, args);

console.log('before populateData');
await this._populateData(args);
} else {
// Update data only
// TODO: Handle changes to config

console.log('update before populateData');
await this._populateData(args);
}
}
Expand All @@ -130,6 +135,7 @@ export default class VegaModifier extends Modifier<VegaModifierArgs> {
viewSpec = args.spec
}

console.log('before Vega.View init');
this._vegaView = new Vega.View(Vega.parse(viewSpec, config), {
renderer: 'svg',
container: element,
Expand All @@ -149,6 +155,7 @@ export default class VegaModifier extends Modifier<VegaModifierArgs> {
args: NamedArgs<VegaModifierArgs>
): Promise<void> {
for (const name of Object.keys(args.data)) {
console.log('_populateData name', name, args.data[name]);
this._vegaView.data(name, args.data[name]);
}

Expand Down

0 comments on commit a4ed8f4

Please sign in to comment.