Skip to content

Commit

Permalink
Merge pull request jupyter-widgets#18 from SylvainCorlay/ipywidgets-6.0
Browse files Browse the repository at this point in the history
Update to ipywidgets 6.0
  • Loading branch information
SylvainCorlay authored Mar 1, 2017
2 parents 1b6764e + 8695192 commit d3ccff6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"github_organization_name": "jupyter",
"python_package_name": "ipywidgetexample",
"npm_package_name": "jupyter-widget-example",
"npm_package_version": "0.1.0",
"project_short_description": "A Custom Jupyter Widget Library"
}
6 changes: 3 additions & 3 deletions {{cookiecutter.github_project_name}}/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "{{ cookiecutter.npm_package_name}}",
"version": "0.0.1",
"name": "{{ cookiecutter.npm_package_name }}",
"version": "{{ cookiecutter.npm_package_version }}",
"description": "{{ cookiecutter.project_short_description }}",
"author": "{{ cookiecutter.author_name }}",
"main": "src/index.js",
Expand All @@ -23,7 +23,7 @@
"webpack": "^1.12.14"
},
"dependencies": {
"jupyter-js-widgets": "^1.1.1",
"jupyter-js-widgets": "^2.1.4",
"underscore": "^1.8.3"
}
}
21 changes: 16 additions & 5 deletions {{cookiecutter.github_project_name}}/js/src/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@ var _ = require('underscore');


// Custom Model. Custom widgets models must at least provide default values
// for model attributes, including `_model_name`, `_view_name`, `_model_module`
// and `_view_module` when different from the base class.
// for model attributes, including
//
// When serialiazing entire widget state for embedding, only values different from the
// defaults will be specified.
// - `_view_name`
// - `_view_module`
// - `_view_module_version`
//
// - `_model_name`
// - `_model_module`
// - `_model_module_version`
//
// when different from the base class.

// When serialiazing the entire widget state for embedding, only values that
// differ from the defaults will be specified.
var HelloModel = widgets.DOMWidgetModel.extend({
defaults: _.extend({}, widgets.DOMWidgetModel.prototype.defaults, {
defaults: _.extend(_.result(this, 'widgets.DOMWidgetModel.prototype.defaults'), {
_model_name : 'HelloModel',
_view_name : 'HelloView',
_model_module : '{{ cookiecutter.npm_package_name }}',
_view_module : '{{ cookiecutter.npm_package_name }}',
_model_module_version : '{{ cookiecutter.npm_package_version }}',
_view_module_version : '{{ cookiecutter.npm_package_version }}',
value : 'Hello World'
})
});
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.github_project_name}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def run(self):
]),
],
'install_requires': [
'ipywidgets>=5.1.5',
'ipywidgets>=6.0.0',
],
'packages': find_packages(),
'zip_safe': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ class HelloWorld(widgets.DOMWidget):
_model_name = Unicode('HelloModel').tag(sync=True)
_view_module = Unicode('{{ cookiecutter.npm_package_name }}').tag(sync=True)
_model_module = Unicode('{{ cookiecutter.npm_package_name }}').tag(sync=True)
_view_module_version = Unicode('^{{ cookiecutter.npm_package_version }}').tag(sync=True)
_model_module_version = Unicode('^{{ cookiecutter.npm_package_version }}').tag(sync=True)
value = Unicode('Hello World!').tag(sync=True)

0 comments on commit d3ccff6

Please sign in to comment.