跳转到主要内容

交互式小部件库,暴露浏览器Canvas API

项目描述

ipycanvas

交互式Canvas在Jupyter中

Documentation Binder JupyterLite Downloads Join the chat at https://gitter.im/jupyter-widgets-contrib/ipycanvas

ipycanvas是一个轻量级、快速且稳定的库,将浏览器的Canvas API暴露给IPython。它允许您直接从Python绘制简单的图形,如文本、线条、多边形、弧线、图像等。这个简单的工具集允许您绘制几乎任何东西!

在线尝试!

您可以点击此徽章在线尝试:[点击此处](#)

Binder

文档

您可以通过以下链接阅读文档:https://ipycanvas.readthedocs.io

有问题?

如果您有任何问题,或想分享您使用ipycanvas所做的,请在GitHub上发起新的讨论

或者加入Gitter频道:加入 https://gitter.im/jupyter-widgets-contrib/ipycanvas 的聊天

安装

您可以使用 pip 进行安装

pip install ipycanvas orjson

或者使用 conda

conda install -c conda-forge ipycanvas

如果您使用 jupyterlab <= 2

conda install -c conda-forge yarn
jupyter labextension install @jupyter-widgets/jupyterlab-manager ipycanvas

开发安装指南,可以在 这里 找到

示例

创建约翰·康威的生命游戏

John Conway's Game Of Life

使用RoughCanvas为您的绘图添加“手绘”风格

RoughCanvas

从IPython绘制粒子

Particles

自定义精灵

Sprites

直接从NumPy数组绘制数据

NumPy

在Python中完全创建自己的绘图库

Plotting

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面