反应台仪表板组件

dash-react-table的Python项目详细描述


仪表板反应表

react table的仪表板部件

dash react table提供了构建在react-table之上的轻量级表组件。

注意:以上链接将带您进入版本6,这是我用于此组件的版本(准确地说是v6.8.6)

安装

dash react table位于pypi上,可以通过 运行

pip install dash-react-table

用法

importdashimportdash_html_componentsashtmlimportpandasaspdfromdash_react_tableimportDashReactTabledf=pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')data=df.to_json(orient='records')columns=[{'Header':i,'accessor':i}foriindf.columns]app.layout=html.Div([DashReactTable(id='table',data=data,columns=columns)])if__name__=='__main__':app.run_server(debug=True)

DashReactTable属性

AttributeDescriptionTypeDefault value
idOptional identifier used to reference component in callbacksstring
dataAn array of datalist of dict where each dict corresponds to a row of data
columnsAn array of column attributeslist of dict which can contain the followings keys: Header(string), accessor(string), sortable(boolean), filterable(boolean), show(boolean), width(int), minWidth(int), maxWidth(int), className(string), style(string), headerClassName(string), headerStyle(string)
showPaginationTurn on paginationbooleanfalse
showPaginationTopPut pagination on topbooleanfalse
showPaginationBottomPut pagination on topbooleantrue
showPageSizeOptionsProvide options for paginationbooleantrue
pageSizeOptionsDefine the size options for paginationlist of int[5, 10, 20, 25, 50, 100]
defaultPageSizeDefault page sizeint20
minRowsControls the minimum number of rows to displayint
sortableAllow columns to be sortedbooleantrue
resizableAllow columns to be resizablebooleantrue
filterableAllow columns to be filterable. The component has a custom filter which performs a case/order insensitive filter.booleanfalse
classNameAdd classname to react-table. The main use case for this is to add "-striped" and/or "-highlight"string
styleinline table stylesdict
conditionalFormattingCustom conditional color formatting. Currently only supports d3.scaleThreshold.dict with contains the following keys: domain(list of int), range(list of dict styles), ignore(list of string)

附加注释:

  • 所有列属性都可以覆盖表级属性

  • 若要使用条件格式,n个域值必须有n+1个范围值。范围值必须是驼峰样式。

  • 若要生成具有固定页眉的滚动表,请确保将固定高度添加到表的样式属性中。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java同步块与私有不可变对象和同步方法的差异   OracleDataSource、OracleUCP、Commons DBCP和Tomcat连接池之间的java差异?   java在文本文件中写入对象   java访问web服务   如何用java代码并行读取拼花地板文件   spring是否可以将运行时未知的Avro消息转换为特定的Java类   具有复杂对象的java Spring数据MongoDB addToSet()   java ArrayList是否删除元素,是否向下移动列表?   Vaadin中按钮的java多行标题不起作用   java为什么要使用@PropertySource而不是PropertyPlaceHolderConfigure?   java如何检查网站链接是否有数据(图片)或网站是否无效?   java如何禁用对jsp页面的直接访问?   用java实现matlab递归文件夹读取。伊奥。文件   为什么是java。伊奥。FileDescriptor的构造函数是公共的吗?   在java中关闭扫描程序时无法访问的代码?   搜索Java模拟退火接受概率