Skip to content

Commit

Permalink
Added Feature Cover Json Data Node in Data Node control (#2164)
Browse files Browse the repository at this point in the history
* Added Feature Cover Json Data Node in Data Node control

* fixed the requested changes

* Adding example file

* Fixed the requested Changes

* fixing linter error

* added the code in display mode

* added new library

* Moved importation of library in single file

* removing uncesseary lines

* Update package.json

* Update DataNodeViewer.tsx

* Update package.json

* Update DataNodeViewer.tsx

* fixing tests

* fixing failing tests again

* Added theme and done some requested changes

* Adding json file

* json file

* Update DataNodeViewer.tsx

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
  • Loading branch information
THEBOSS0369 and FredLL-Avaiga authored Nov 13, 2024
1 parent 5ba8435 commit 1486c44
Show file tree
Hide file tree
Showing 7 changed files with 2,230 additions and 279 deletions.
19 changes: 19 additions & 0 deletions doc/gui/examples/controls/datanode_viewer_json.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Sample Data",
"type": "Example JSON",
"attributes": {
"id": 123,
"description": "A simple JSON structure for demonstration",
"values": [
1,
2,
3,
4,
5
],
"nested": {
"flag": true,
"count": 10
}
}
}
22 changes: 22 additions & 0 deletions doc/gui/examples/controls/datanode_viewer_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import taipy as tp
import taipy.gui.builder as tgb
from taipy import Config, Orchestrator, Scope
from taipy.gui import Gui

json_config_node = Config.configure_json_data_node(
id="json_node",
default_path="./datanode_viewer_json.json",
scope=Scope.GLOBAL,
)

with tgb.Page() as data_node_viewer:
tgb.data_node(
data_node="{json_data_node}"
)

gui = Gui(page=data_node_viewer)

if __name__ == "__main__":
Orchestrator().run()
json_data_node = tp.create_global_data_node(json_config_node)
gui.run(title="Datanode Viewer - json support")
Loading

0 comments on commit 1486c44

Please sign in to comment.