niivue / ipyniivue

A WebGL-powered Jupyter Widget for Niivue based on anywidget
BSD 2-Clause "Simplified" License
25 stars 8 forks source link

NiivueOptions syntax #8

Closed AnthonyAndroulakis closed 1 year ago

AnthonyAndroulakis commented 1 year ago

Currently, the NiivueOptions for a Niivue widget can be accessed like so: nv.text_height.
However, this does not exactly mirror the method of accessing an option from a js Niivue object, which is like so: nv.opts.textHeight.

The naming difference (snake case vs camel case) is normal, however, the widget version is missing the "opts." text. Ideally, a Niivue widget could have one of its options modified like so:

from ipyniivue import Niivue
nv = Niivue()
nv.opts.text_height = 0.05
hanayik commented 1 year ago

@AnthonyAndroulakis, one option that we can look into is creating more "setter" and "getter" methods in the core NiiVue project.

So we could have something like nv.setTextHeight(newHeight), and nv.getTextHeight()

AnthonyAndroulakis commented 1 year ago

Good idea, that would be helpful.