-
Notifications
You must be signed in to change notification settings - Fork 3
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
A few changes #4
Comments
@dou-du I suggest that we start working with PRs so I can give feedback before it's merged? |
Sure, I will work on the develop branch. |
Hi Giovanni @giovannipizzi , This issue is quite problematic to fix. First, I was struggling with a Traitlets bug: For example, self.selected_elements[1] = "H" will not trigger the Javascript function. This For the selected_states and selected_elements, I try to consider all the possible cases: I also update the binder docs. Please check my pull request #13 |
There are more bugs. Forget about the pull request. I think it is very problematic to have two separate variable (selected_elements, selected_states). I will use a dictionary instead. |
Here a few minor changes that I would do:
noselect_color
->unselected_color
to be consistent withselected_colors
widget-periodictable/widget_periodictable/periodic_table.py
Line 41 in 86a8e17
state
is very large. Something likewidget-periodictable/src/widget.ts
Line 93 in 86a8e17
(replace
noselcted
withunselected
)on_set_from_ptyhon
widget.selected_elements = ['Li', 'H']
, they get selected but with different state. How do I chose the state?Li
to change its state, they jump back (at least it happened to me once, I cannot reproduce). Definitely one thing I can reproduce is that if I select with different states some other elements, say 'Si' and 'Ge', and then I callwidget.selected_elements = ['Li', 'H']
, when I click onSi
andGe
(now unselected) they don't start from state 0, but from some other state.widget.selected_elements
is['Li', 'H', 'B', 'Al', 'Ga', 'In']
andwidget.selected_states
is[0, 1, 2, 0, 0, 0, 0]
, a call towidget.get_elements_by_state(0)
crashes withThe text was updated successfully, but these errors were encountered: