-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Carifio24/more-readme
More README updates
- Loading branch information
Showing
3 changed files
with
120 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "75a31f1b-a32a-42ba-a016-f324faa9f3a7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from glue.core import Data\n", | ||
"from glue_jupyter import jglue\n", | ||
"from glue_plotly.viewers.histogram.viewer import PlotlyHistogramView\n", | ||
"from glue_plotly.viewers.scatter.viewer import PlotlyScatterView" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0746adc6-dbe1-4f85-8690-da24458667c0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app = jglue()\n", | ||
"session = app.session\n", | ||
"dc = app.session.data_collection" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "95d749da-73c8-432a-9a23-85d37e1b6fb5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from random import randint\n", | ||
"x = [randint(0, 100) for _ in range(100)]\n", | ||
"y = [randint(300, 400) for _ in range(100)]\n", | ||
"data = Data(label='data', x=x, y=y)\n", | ||
"dc.append(data)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "cf42768e-6d31-4375-90ee-facd8d19800a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"viewer = app.new_data_viewer(PlotlyScatterView, data=data)\n", | ||
"layer = viewer.layers[0]\n", | ||
"layer.state.color = \"#ff0000\"\n", | ||
"layer.state.size = 4" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3e66be74-929f-4cfa-910c-9d3b65b4ac91", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"viewer = app.new_data_viewer(PlotlyHistogramView, data=data)\n", | ||
"layer = viewer.layers[0]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4f9d9ffe-ec2e-4d7f-aa8b-8b2a7524b9c2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.