Core Components of pyxley (pyxley之核心组成部分)
来源:互联网 发布:平板装ubuntu 编辑:程序博客网 时间:2024/06/05 08:19
In Pyxley, the core component is the UILayout. This component iscomposed of a list of charts and filters, a single Reactcomponent from a JavaScript file, and the Flask app.
在Pyxley中,核心部分是UI布局。 它由 1.图表和过滤器组成并通过JavaScript支撑的交互组件列表 和 2.Flask应用程序组成。
#Make a UI #创建一个 UI布局from pyxley import UILayout ui = UILayout( "FilterChart", "./static/bower_components/pyxley/build/pyxley.js", "component_id")
This will create a UI object that’s based on the FilterChart Reactcomponent in pyxley.js. It will be bound to an html div element called component_id.
这将创建一个基于pyxley.js中的FilterChart Reactcomponent(filter-chart交互组件) 的UI对象。 UI对象将被绑定至一个component_id,其对应为一个html div元素
If we wanted to add a filter and a chart we could do so with the following
如果想添加一个 筛选器 和 一个图表,可操作如下
# Make a Button #创建一个按钮cols = [c for c in df.columns if c != "Date"]btn = SelectButton("Data", cols, "Data", "Steps")# Make a FilterFrame and add the button to the UIui.add_filter(btn)# Make a Figure, add some settings, make a line plotfig = Figure("/mgchart/", "mychart")fig.graphics.transition_on_update(True)fig.graphics.animate_on_load()fig.layout.set_size(width=450, height=200)fig.layout.set_margin(left=40, right=40)lc = LineChart(sf, fig, "Date", ["value"], init_params={"Data": "Steps"}, timeseries=True)ui.add_chart(lc)
Calling the ui.add_chart and ui.add_filter methods simply addsthe components we’ve created to the layout.
app = Flask(__name__)sb = ui.render_layout(app, "./static/layout.js")
Calling ui.render_layout builds the JavaScript file containing everything we’ve created.
Charts
Charts are meant to span any visualization of data we wish to construct. This includesline plots, histograms, tables, etc. Several wrappers have been introduced and morewill be added over time.
Implementation
All charts are UIComponents that have the following attributes and methods
* An endpoint route method. The user may specify one to override the default.
* A url attribute that the route function is assigned to by the flask app.
* A chart_id attribute that specifies the element id.
* A to_json method that formats the json response.
Filters
Filters are implemented in nearly the same way that charts are implemented. The onlydifference is the lack of the to_json method.
- Core Components of pyxley (pyxley之核心组成部分)
- JavaScript核心组成部分
- Java NIO核心组成部分
- YARN--Core components
- 五 iOS之 Core Animation(核心动画)
- js的三大核心组成部分
- COMPONENTS OF SAP NETWEAVER
- Components of OpenStack
- Swing shielding of components
- Persisting State of Components
- Resource Components of Spring
- Components of Ryu
- Restlet core 核心包之Security package. Part 1.
- Restlet core 核心包之Security package. Part 2.
- Restlet core 核心包之Security package. Part 3.
- Restlet core 核心包之Security package. Part 4.
- 核心动画Core Animation系列之概述和CABasicAnimation
- Spark Core核心编程之广播变量剖析
- 很菜很菜的一个C#课程设计实验
- UITextFieldDelegate协议中各个方法的作用与Xcode中AppDelegate.m中自动生成各个方法的作用(iOS)
- 《C++ primer plus》附录G:STL方法与函数(三) 学习笔记
- mysql外连接的总结
- 数据类型2
- Core Components of pyxley (pyxley之核心组成部分)
- Android系统应用不支持读写存储
- C++实验4:星号符
- 树形控件Tree Control
- 第二本书unit3
- 鸣人的影分身
- 关于使用badboy录制jmeter时报脚本错误的解决方法
- opencv 手动画轮廓 生成掩膜
- NDK编译Libyuv