File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# Build artifacts
55dash_ag_grid /*
66! dash_ag_grid /__init__.py
7+ ! dash_ag_grid /_version.py
8+ ! dash_ag_grid /themes.py
79R /
810deps /
911man /
Original file line number Diff line number Diff line change 99# noinspection PyUnresolvedReferences
1010from ._imports_ import *
1111from ._imports_ import __all__
12+ from dash_ag_grid import themes
1213
1314if not hasattr (_dash , '__plotly_dash' ) and not hasattr (_dash , 'development' ):
1415 print ('Dash was not successfully imported. '
1516 'Make sure you don\' t have a file '
1617 'named \n "dash.py" in your current directory.' , file = _sys .stderr )
1718 _sys .exit (1 )
1819
19- _basepath = _os .path .dirname (__file__ )
20- _filepath = _os .path .abspath (_os .path .join (_basepath , 'package-info.json' ))
21- with open (_filepath ) as f :
22- package = json .load (f )
20+ from ._version import __version__ , grid_version , get_package_info
2321
22+ package = get_package_info ()
2423package_name = package ['name' ].replace (' ' , '_' ).replace ('-' , '_' )
25- __version__ = package ['version' ]
26- grid_version = package ['dependencies' ]['ag-grid-community' ]
2724
2825_current_path = _os .path .dirname (_os .path .abspath (__file__ ))
2926
Original file line number Diff line number Diff line change 1+ import json
2+ import os
3+
4+ def get_package_info ():
5+ basepath = os .path .dirname (__file__ )
6+ filepath = os .path .abspath (os .path .join (basepath , 'package-info.json' ))
7+ with open (filepath ) as f :
8+ return json .load (f )
9+
10+ package = get_package_info ()
11+ __version__ = package ['version' ]
12+ grid_version = package ['dependencies' ]['ag-grid-community' ]
Original file line number Diff line number Diff line change 1+ from ._version import grid_version
2+
3+ _base_url = f"https://cdn.jsdelivr.net/npm/ag-grid-community@{ grid_version } /styles"
4+
5+ BASE = f"{ _base_url } /ag-grid.min.css"
6+ ALPINE = f"{ _base_url } /ag-theme-alpine.min.css"
7+ BALHAM = f"{ _base_url } /ag-theme-balham.min.css"
8+ MATERIAL = f"{ _base_url } /ag-theme-material.min.css"
9+ QUARTZ = f"{ _base_url } /ag-theme-quartz.min.css"
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ function DashAgGrid(props) {
5757DashAgGrid . dashRenderType = true ;
5858
5959DashAgGrid . defaultProps = {
60- className : 'ag-theme-alpine ' ,
60+ className : '' ,
6161 resetColumnState : false ,
6262 exportDataAsCsv : false ,
6363 selectAll : false ,
Original file line number Diff line number Diff line change 77legacy theme in action.
88"""
99
10- app = Dash (__name__ , assets_folder = "assets_legacy_themes/" )
10+ app = Dash (__name__ , external_stylesheets = [ dag . themes . BASE , dag . themes . MATERIAL ] )
1111
1212rowData = [
1313 {"weight" : 0.074657 , "date" : "01/01/2024" },
1717]
1818
1919columnDefs = [
20- {"field" : "weight" , "cellDataType" : "percentage" },
21- {"field" : "date" , "cellDataType" : "dateString" },
20+ {"field" : "weight" },
21+ {"field" : "date" },
2222]
2323
2424app .layout = html .Div (
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ def test_us001_user_style(dash_duo):
4141 defaultColDef = defaultColDef ,
4242 rowData = rowData ,
4343 style = {"height" : "500px" , "width" : "500px" },
44+ className = "ag-theme-alpine" ,
4445 ),
4546 ]
4647 )
You can’t perform that action at this time.
0 commit comments