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

add pushing of subfields #289

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

add pushing of subfields #289

wants to merge 1 commit into from

Conversation

hhaensel
Copy link
Member

@hhaensel hhaensel commented Oct 7, 2024

With this PR it is possible to push to subfields, e.g.

push!(model, Symbol("plot.data") => Plot(scatter(y = 1:10)).data)

or

push!(model, :var"plot.data" => Plot(scatter(y = 1:10)).data)

This is currently only implemented on the js side.
We could implement it on the Julia side as well to support

push!(model, :var"plot.data")

We could also support array indexing

@essenciary , @protozoo , @PGimenez
Happy to hear, what you think.

@hhaensel
Copy link
Member Author

hhaensel commented Oct 8, 2024

Array indexing works already without adaptation:

hh = {data: 'test', layout: {nest: ['me', 'you']}}
getField(hh, 'layout.nest.1'.split('.'))
// 'you'

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.

1 participant