Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly unpack vega datasets #927

Merged
merged 1 commit into from Jan 7, 2020
Merged

Correctly unpack vega datasets #927

merged 1 commit into from Jan 7, 2020

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 7, 2020

No description provided.

@philippjfr philippjfr merged commit 14c588c into master Jan 7, 2020
1 of 2 checks passed
@@ -55,6 +55,12 @@ export class VegaPlotView extends HTMLBoxView {
this.model.data.data['values'] = datasets['data']
delete datasets['data']
}
for (const d of this.model.data.data) {
if (d.name in datasets) {
Copy link
Collaborator

@mattpap mattpap Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being pedantic, this should use datasets.hasOwnProperty(d.name). This way, if d.name overlaps with an inherited member, but d.name isn't generated by this._fetch_datasets(), then you won't get a false positive in this clause. Alternatively _fetch_datasets() could return a plain object created with Object.create(null) instead of {}. Then you can use in operator freely.

sthagen added a commit to sthagen/holoviz-panel that referenced this issue Jan 7, 2020
Correctly unpack vega datasets (holoviz#927)
@philippjfr philippjfr deleted the vega_data_unpack branch Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants