-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
195132f
commit f3571a0
Showing
10 changed files
with
128 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
{ | ||
"": { "color": ["#ffca28", "#ffc107"], "icon": "fa-regular fa-folder" }, | ||
".csv": { "color": ["#4caf50", "#00c853"], "icon": "fa-solid fa-table" }, | ||
".txt": { "color": ["#4caf50", "#00c853"], "icon": "fa-solid fa-table" }, | ||
".tif": { "color": ["#9c27b0", "#673ab7"], "icon": "fa-regular fa-image" }, | ||
".tiff": { "color": ["#9c27b0", "#673ab7"], "icon": "fa-regular fa-image" }, | ||
".vrt": { "color": ["#9c27b0", "#673ab7"], "icon": "fa-regular fa-image" }, | ||
"": { "color": "primary_contrast", "icon": "fa-regular fa-folder" }, | ||
".csv": { "color": "secondary_contrast", "icon": "fa-solid fa-table" }, | ||
".txt": { "color": "secondary_contrast", "icon": "fa-solid fa-table" }, | ||
".tif": { "color": "secondary_contrast", "icon": "fa-regular fa-image" }, | ||
".tiff": { "color": "secondary_contrast", "icon": "fa-regular fa-image" }, | ||
".vrt": { "color": "secondary_contrast", "icon": "fa-regular fa-image" }, | ||
".shp": { | ||
"color": ["#9c27b0", "#673ab7"], | ||
"color": ["secondary_contrast"], | ||
"icon": "fa-solid fa-vector-square" | ||
}, | ||
".geojson": { | ||
"color": ["#9c27b0", "#673ab7"], | ||
"color": ["secondary_contrast"], | ||
"icon": "fa-solid fa-vector-square" | ||
}, | ||
"DEFAULT": { "color": ["#00bcd4", "#03a9f4"], "icon": "fa-regular fa-file" }, | ||
"DEFAULT": { "color": "anchor", "icon": "fa-regular fa-file" }, | ||
"PARENT": { | ||
"color": ["#424242", "#ffffff"], | ||
"color": "anchor", | ||
"icon": "fa-regular fa-folder-open" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
sepal_ui/templates/panel_app/component/tile/widget_tile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
"""A demo tile showing some of the most frequent widgets available in the sepal_ui library.""" | ||
|
||
import ipyvuetify as v | ||
import sepal_ui.sepalwidgets as sw | ||
from sepal_ui.mapping.sepal_map import SepalMap | ||
|
||
|
||
class WidgetTile(sw.Card): | ||
def __init__(self): | ||
"""A demo tile showing all the widgets available in the sepal_ui library.""" | ||
# create the card | ||
super().__init__(row=True, wrap=True, _metadata={"mount_id": "widget_tile"}) | ||
|
||
# Create widgets | ||
|
||
select = sw.Select( | ||
label="Select", | ||
v_model="option1", | ||
items=["option1", "option2", "option3"], | ||
outlined=True, | ||
) | ||
|
||
slider = sw.Slider( | ||
label="Slider", | ||
v_model=50, | ||
max=100, | ||
min=0, | ||
thumb_label=True, | ||
step=1, | ||
) | ||
|
||
btn = sw.Btn("Button", color="primary", outlined=True) | ||
btn1 = sw.Btn("Button", color="secondary", outlined=True) | ||
btn2 = sw.Btn("Button", color="primary") | ||
btn3 = sw.Btn("Button", color="secondary") | ||
file_input = sw.FileInput() | ||
map_ = SepalMap(zoom=10) | ||
|
||
title = v.CardTitle(children=["test widgets tile"]) | ||
|
||
card = v.Card(class_="mb-4 pa-2", raised=True, xs12=True, children=[title, map_]) | ||
|
||
loading_card = v.Card( | ||
class_="mb-6 pa-2", | ||
raised=True, | ||
xs12=True, | ||
children=[title] + ["content " * 100], | ||
loading=True, | ||
) | ||
|
||
warning_alert = sw.Alert().add_msg("This is a warning alert", type_="warning") | ||
error_alert = sw.Alert().add_msg("This is an error alert", type_="error") | ||
info_alert = sw.Alert().add_msg("This is an info alert", type_="info") | ||
success_alert = sw.Alert().add_msg("This is a success alert", type_="success") | ||
|
||
# Add widgets to the layout | ||
|
||
self.children = [ | ||
card, | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[select]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[file_input]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[slider]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[btn]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[btn1]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[btn2]), | ||
v.Flex(class_="mb-2", xs12=True, lg6=True, xl4=True, children=[btn3]), | ||
v.Flex( | ||
class_="mb-2", | ||
xs12=True, | ||
lg6=True, | ||
xl4=True, | ||
children=[warning_alert], | ||
), | ||
v.Flex( | ||
class_="mb-2", | ||
xs12=True, | ||
lg6=True, | ||
xl4=True, | ||
children=[error_alert], | ||
), | ||
v.Flex( | ||
class_="mb-2", | ||
xs12=True, | ||
lg6=True, | ||
xl4=True, | ||
children=[info_alert], | ||
), | ||
v.Flex( | ||
class_="mb-2", | ||
xs12=True, | ||
lg6=True, | ||
xl4=True, | ||
children=[success_alert], | ||
), | ||
loading_card, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters