-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version 2 of the state and view schema definitions.
1. We add optional buffer_paths and buffers keys to a model’s state dictionary. 2. We remove the requirement that each schema defines *all* of the properties an object may have, so that we can have backwards-compatible updates by adding optional properties. In other words, removed a number of additionalProperties: false entries in the schema.
- Loading branch information
1 parent
4f7f87f
commit 6a9f470
Showing
7 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Jupyter Interactive Widget State JSON schema.", | ||
"type": "object", | ||
"properties" : { | ||
"version_major" : { | ||
"description": "Format version (major)", | ||
"type": "number", | ||
"minimum": 2, | ||
"maximum": 2 | ||
}, | ||
"version_minor" : { | ||
"description": "Format version (minor)", | ||
"type": "number" | ||
}, | ||
"state": { | ||
"description": "Model State for All Widget Models", | ||
"type": "object", | ||
"additionalProperties" : { | ||
"type": "object", | ||
"properties": { | ||
"model_name": { | ||
"description" : "Name of the JavaScript class holding the model implementation", | ||
"type": "string" | ||
}, | ||
"model_module": { | ||
"description" : "Name of the JavaScript module holding the model implementation", | ||
"type": "string" | ||
}, | ||
"model_module_version": { | ||
"description" : "Semver range for the JavaScript module holding the model implementation", | ||
"type": "string" | ||
}, | ||
"state": { | ||
"description" : "Serialized state of the model", | ||
"type": "object" | ||
}, | ||
"buffer_paths": { | ||
"description" : "Array of paths in the state for the corresponding buffers", | ||
"type": "array", | ||
"items": { | ||
"description": "A path for a binary buffer value.", | ||
"type": "array", | ||
"items": { | ||
"description": "An object key or array index", | ||
"anyOf": [{"type": "string"}, {"type": "number"}] | ||
} | ||
} | ||
}, | ||
"buffers": { | ||
"description" : "Array of base64-encoded binary buffers", | ||
"type": "array", | ||
"items": { | ||
"description": "A base64-encoded binary buffer", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ "model_name", "model_module", "state" ] | ||
} | ||
} | ||
}, | ||
"required": [ "version_major", "version_minor", "state" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Jupyter Interactive Widget View JSON schema.", | ||
"type": "object", | ||
"properties" : { | ||
"version_major" : { | ||
"description": "Format version (major)", | ||
"type": "number", | ||
"minimum": 2, | ||
"maximum": 2 | ||
}, | ||
"version_minor" : { | ||
"description": "Format version (minor)", | ||
"type": "number" | ||
}, | ||
"model_id": { | ||
"description": "Unique identifier of the widget model to be displayed", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ "model_id" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters