Skip to content

Commit

Permalink
Fix one more bug for issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
dou-du committed May 23, 2020
1 parent d7bf982 commit d1e193c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
32 changes: 16 additions & 16 deletions examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 77,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,18 +26,18 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 78,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d0d0ae828dbb42ddaac70ab85f7039a1",
"model_id": "3b0251fe928b47cbba21f9699c07b7e8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"PTableWidget(selected_colors=['red', 'green', 'yellow', '#a6cee3', '#b2df8a'], selected_elements={'Be': 0}, st"
"PTableWidget(allElements=['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', '"
]
},
"metadata": {},
Expand Down Expand Up @@ -73,7 +73,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 79,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 80,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -120,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 81,
"metadata": {},
"outputs": [
{
Expand All @@ -129,7 +129,7 @@
"['La', 'Nd']"
]
},
"execution_count": 34,
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -154,13 +154,13 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 82,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0899a84824a64e95a8f2849bbbb9b117",
"model_id": "772111a4b4d54147b953fbb80d3ba2fe",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -201,13 +201,13 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 83,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7f7efa91bf1f4b8b85d9eff0d590772a",
"model_id": "bc44afc9ef6748bb85d0e64b3e71f0a4",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -254,13 +254,13 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 84,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4144a2a113d246aa9021e1de15a66138",
"model_id": "33ba832340fe45fdb6b905afc520dc12",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -296,13 +296,13 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 85,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e71d9e807571477faf99bd6d9c9ffc1d",
"model_id": "7aed5c6b8d2f4c1da076ad688800588f",
"version_major": 2,
"version_minor": 0
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "widget-periodictable",
"version": "1.3.0",
"version": "1.4.0",
"description": "A jupyter widget to select chemical elements from the periodic table.",
"keywords": [
"jupyter",
Expand Down
2 changes: 1 addition & 1 deletion src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class MCPTableView extends DOMWidgetView {
// Update the model (send back data to python)
// I have to make some changes, since there is some issue
// for Dict in Traitlets, which cannot triggle the update
this.model.set('selected_elements', {"test":100});
this.model.set('selected_elements', {"H": 0});
this.touch();
this.model.set('selected_elements', currentList);
this.touch();
Expand Down
2 changes: 1 addition & 1 deletion widget_periodictable/_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"""

module_name = "widget-periodictable"
module_version = "^1.3.0"
module_version = "^1.4.0"
2 changes: 1 addition & 1 deletion widget_periodictable/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Copyright (c) Giovanni Pizzi and Dou Du.
# Distributed under the terms of the Modified BSD License.

version_info = (1, 3, 0)
version_info = (1, 4, 0)
__version__ = ".".join(map(str, version_info))
2 changes: 1 addition & 1 deletion widget_periodictable/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PTableWidget(DOMWidget):
"Mt","Ds", "Rg", "Cn", "Nh", "Fi", "Mc", "Lv", "Ts", "Og", "La", "Ce", "Pr",
"Nd", "Pm", "Sm", "Eu","Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu","Ac",
"Th", "Pa", "U", "Np", "Pu", "Am","Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr"
]);
]).tag(sync=True)

def __init__(self, states = 1, selected_elements = {}, disabled_color = 'gray', unselected_color = 'pink', selected_colors = ["#a6cee3", "#b2df8a", "#fdbf6f", "#6a3d9a", "#b15928", "#e31a1c", "#1f78b4", "#33a02c", "#ff7f00", "#cab2d6", "#ffff99"]):
super(PTableWidget, self).__init__()
Expand Down

0 comments on commit d1e193c

Please sign in to comment.