-
Notifications
You must be signed in to change notification settings - Fork 45
Add IPython display support #389
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
72daef2
Add _repr_*_ methods to SVG, Agg and Celiagg backends for IPython.
corranwebster d5cdd46
Add an IPython notebook for interactive exploration with Kiva.
corranwebster 33b2263
Merge branch 'master' into enh/ipython-support
jwiggins 35c9bdd
PR feedback
jwiggins 5b814b7
Merge branch 'master' into enh/ipython-support
corranwebster 5d747ed
Put notebook in correct examples directory.
corranwebster d4a73a1
Use celiagg in the example notebook.
corranwebster 92b8c85
Add tests (and some fixes from test runs).
corranwebster 469f8e2
Remove IPython noise
jwiggins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,85 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# Kiva API Explorer\n", | ||
| "\n", | ||
| "This notebook allows you to experiment with the K" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "from math import pi\n", | ||
| "from kiva import constants\n", | ||
| "from kiva.fonttools import Font" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "from kiva.celiagg import GraphicsContext\n", | ||
| "\n", | ||
| "gc = GraphicsContext((500, 500), pix_format='rgba32')\n", | ||
| "\n", | ||
| "with gc:\n", | ||
| " gc.set_fill_color((1.0, 1.0, 0.0, 1.0))\n", | ||
| " gc.arc(200, 200, 100, 0, 2*pi)\n", | ||
| " gc.fill_path()\n", | ||
| "\n", | ||
| " with gc:\n", | ||
| " gc.set_font(Font('Times New Roman', size=24))\n", | ||
| " gc.translate_ctm(200, 200)\n", | ||
| " for i in range(0, 12):\n", | ||
| " gc.set_fill_color((i/12.0, 0.0, 1.0-(i/12.0), 0.75))\n", | ||
| " gc.rotate_ctm(2*pi/12.0)\n", | ||
| " gc.show_text_at_point(\"Hello World\", 20, 0)\n", | ||
| "\n", | ||
| " gc.set_stroke_color((0.0, 0.0, 1.0, 1.0))\n", | ||
| " gc.set_line_width(7)\n", | ||
| " gc.set_line_join(constants.JOIN_ROUND)\n", | ||
| " gc.set_line_cap(constants.CAP_ROUND)\n", | ||
| " gc.rect(100, 400, 50, 50)\n", | ||
| " gc.stroke_path()\n", | ||
| "\n", | ||
| "gc" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "Python 3", | ||
| "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.6.12" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 2 | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hasn't been a problem yet, but we might want to add support for formats without alpha at some point.