Skip to content

Commit 337b925

Browse files
committed
0.4.1 - fix docstrings and typehints.
Fix: Update the docstring of the component and the typehint `ThemeConfigs` to the newest version.
1 parent dbc9929 commit 337b925

File tree

5 files changed

+49
-43
lines changed

5 files changed

+49
-43
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
## CHANGELOG
66

7+
### 0.4.1 @ 10/26/2024
8+
9+
#### :wrench: Fix
10+
11+
1. Fix: Update the docstring of the component and the typehint `ThemeConfigs` to the newest version.
12+
713
### 0.4.0 @ 10/21/2024
814

915
#### :mega: New

dash_json_grid/__init__.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ class DashJsonGrid(_DashJsonGrid, _MixinDataRoute, _MixinFile):
123123
Often used with CSS to style elements with common properties.
124124
125125
- data (dict | list | number | string | boolean; required):
126-
The JSON object or array to be transformed into a grid table.
126+
The JSON-serializable data to be transformed into a grid table.
127127
128128
- default_expand_depth (number; default 0):
129129
The depth to which the grid is expanded by default.
130130
131131
- default_expand_key_tree (dict; optional):
132132
Tree-like structure with all keys that needs to be expanded. This
133-
structure needs to be a dictionary mimicing the structure of the
133+
structure needs to be a `Mapping` mimicing the structure of the
134134
data.
135135
136136
- highlight_selected (boolean; default True):
@@ -155,45 +155,45 @@ class DashJsonGrid(_DashJsonGrid, _MixinDataRoute, _MixinFile):
155155
The text that needs to be searched in the JSON data.
156156
157157
- selected_path (list; optional):
158-
keyPath captured by the onSelect method of the grid viewer. This
159-
value is a sequence of indicies used for locating the element of
160-
the selected data. Due to the limitation of the exported
158+
`keyPath` captured by the `onSelect` method of the grid viewer.
159+
This value is a sequence of indicies used for locating the element
160+
of the selected data. Due to the limitation of the exported
161161
functionalities, this value cannot be reset by the callback. In
162162
other words, using it with callbacks.Output will not take effects.
163163
164164
- style (dict; optional):
165165
Defines CSS styles which will override styles previously set.
166166
167-
- theme (dict; default 'default'):
168-
The theme (name) that needs to be applied. If a dictionary is
167+
- theme (dict; default "default"):
168+
The theme (name) that needs to be applied. If a `Mapping` is
169169
specified, will customize the color code of each part of grid
170170
viewer.
171171
172-
`theme` is a a value equal to: 'default', 'dracula', 'monokai',
173-
'oceanicPark', 'panda', 'gruvboxMaterial', 'tokyoNight', 'remedy',
174-
'atlanticNight', 'defaultLight', 'defaultLight2', 'slime',
175-
'spacegray', 'blueberryDark', 'nord', 'nightOwl', 'oneMonokai',
176-
'cobaltNext', 'shadesOfPurple', 'codeBlue', 'softEra',
177-
'atomMaterial', 'evaDark', 'moonLight', 'inherit', 'unset' | dict
172+
`theme` is a a value equal to: "default", "dracula", "monokai",
173+
"oceanicPark", "panda", "gruvboxMaterial", "tokyoNight", "remedy",
174+
"atlanticNight", "defaultLight", "defaultLight2", "slime",
175+
"spacegray", "blueberryDark", "nord", "nightOwl", "oneMonokai",
176+
"cobaltNext", "shadesOfPurple", "codeBlue", "softEra",
177+
"atomMaterial", "evaDark", "moonLight", "inherit", "unset" | dict
178178
with keys:
179179
180180
- bgColor (string; optional):
181-
Background color.
181+
Background color of the whole grid view.
182182
183183
- booleanColor (string; optional):
184184
Text color of boolean variables.
185185
186+
- borderColor (string; optional):
187+
Border color of the whole grid view.
188+
186189
- cellBorderColor (string; optional):
187190
Background color of table cells.
188191
189-
- highlightBgColor (string; optional):
190-
Background color when this part is highlighted.
191-
192192
- indexColor (string; optional):
193-
Text color of array indicies.
193+
Text color of sequence indicies.
194194
195-
- keyNameColor (string; optional):
196-
Text color of JSON keys.
195+
- keyColor (string; optional):
196+
Text color of mapping keys.
197197
198198
- numberColor (string; optional):
199199
Text color of numeric values.
@@ -204,17 +204,18 @@ class DashJsonGrid(_DashJsonGrid, _MixinDataRoute, _MixinFile):
204204
- searchHighlightBgColor (string; optional):
205205
Background color of the part highlighted by the search.
206206
207+
- selectHighlightBgColor (string; optional):
208+
Background color when this part is highlighted by the
209+
selection.
210+
207211
- stringColor (string; optional):
208212
Text color of strings.
209213
210-
- tableBorderColor (string; optional):
211-
Border color of the whole table.
212-
213214
- tableHeaderBgColor (string; optional):
214215
Background color of the table header.
215216
216-
- tableHeaderColor (string; optional):
217-
Text color of the table header."""
217+
- tableIconColor (string; optional):
218+
Text color of the icon in the table header."""
218219

219220

220221
for _component in __all__:

dash_json_grid/typehints.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ class ThemeConfigs(TypedDict, total=False):
2323
"""Detailed configuration for defining a customized theme."""
2424

2525
bgColor: str
26-
"""Background color."""
26+
"""Background color of the whole grid view."""
2727

2828
booleanColor: str
2929
"""Text color of boolean variables."""
3030

31+
borderColor: str
32+
"""Border color of the whole grid view."""
33+
3134
cellBorderColor: str
3235
"""Background color of table cells."""
3336

34-
highlightBgColor: str
35-
"""Background color when this part is highlighted."""
36-
3737
indexColor: str
38-
"""Text color of array indicies."""
38+
"""Text color of sequence indicies."""
3939

40-
keyNameColor: str
41-
"""Text color of JSON keys."""
40+
keyColor: str
41+
"""Text color of mapping keys."""
4242

4343
numberColor: str
4444
"""Text color of numeric values."""
@@ -49,14 +49,14 @@ class ThemeConfigs(TypedDict, total=False):
4949
searchHighlightBgColor: str
5050
"""Background color of the part highlighted by the search."""
5151

52+
selectHighlightBgColor: str
53+
"""Background color when this part is highlighted by the selection."""
54+
5255
stringColor: str
5356
"""Text color of strings."""
5457

55-
tableBorderColor: str
56-
"""Border color of the whole table."""
57-
5858
tableHeaderBgColor: str
5959
"""Background color of the table header."""
6060

61-
tableHeaderColor: str
62-
"""Text color of the table header."""
61+
tableIconColor: str
62+
"""Text color of the icon in the table header."""

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dash_json_grid",
33
"packageManager": "[email protected]",
4-
"version": "0.4.0",
4+
"version": "0.4.1",
55
"description": "Dash porting version of the react project React JSON Grid. Provide structured and nested grid table view of complicated JSON objects/arrays.",
66
"repository": {
77
"type": "git",

src/lib/components/DashJsonGrid.react.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ DashJsonGrid.propTypes = {
7878
/**
7979
* `keyPath` captured by the `onSelect` method of the grid viewer. This value is a
8080
* sequence of indicies used for locating the element of the selected data.
81-
*
8281
* Due to the limitation of the exported functionalities, this value cannot be
8382
* reset by the callback. In other words, using it with callbacks.Output will
8483
* not take effects.
@@ -152,10 +151,6 @@ DashJsonGrid.propTypes = {
152151
* Border color of the whole grid view.
153152
*/
154153
borderColor: PropTypes.string,
155-
/**
156-
* Background color when this part is highlighted by the selection.
157-
*/
158-
selectHighlightBgColor: PropTypes.string,
159154
/**
160155
* Background color of table cells.
161156
*/
@@ -192,6 +187,10 @@ DashJsonGrid.propTypes = {
192187
* Text color of the icon in the table header.
193188
*/
194189
tableIconColor: PropTypes.string,
190+
/**
191+
* Background color when this part is highlighted by the selection.
192+
*/
193+
selectHighlightBgColor: PropTypes.string,
195194
/**
196195
* Background color of the part highlighted by the search.
197196
*/

0 commit comments

Comments
 (0)