-
Notifications
You must be signed in to change notification settings - Fork 16
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
0437f80
commit c82b157
Showing
32 changed files
with
716 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.webviz-dropdown .Select--multi .Select-value { | ||
background-color: var(--menuLinkBackgroundHover); | ||
border-color: var(--menuLinkBackgroundHover); | ||
color: var(--menuLinkColor) | ||
} |
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,22 @@ | ||
.webviz-frame { | ||
border-radius: 5px; | ||
background-color: #F9F9F9; | ||
margin: 10px; | ||
padding: 15px; | ||
position: relative; | ||
box-shadow: 0px 0px 3px 0.5px lightgrey; | ||
|
||
} | ||
|
||
.webviz-frame:hover { | ||
box-shadow: 0px 0px 4px 2px lightgrey; | ||
} | ||
|
||
.webviz-frame-no-hover { | ||
border-radius: 5px; | ||
background-color: #F9F9F9; | ||
margin: 10px; | ||
padding: 15px; | ||
position: relative; | ||
box-shadow: 0px 0px 4px 0.5px lightgrey; | ||
} |
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,10 @@ | ||
.webviz-header { | ||
cursor: pointer; | ||
color: #ff1243; | ||
border-bottom-style: solid; | ||
border-width: thin; | ||
border-color: #ff1243; | ||
font-weight: bold; | ||
font-size: 20px; | ||
margin-bottom: 25px; | ||
} |
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,18 @@ | ||
.webviz-underlined-label { | ||
font-size: 15px; | ||
cursor: pointer; | ||
color: #007079; | ||
border-bottom-style: solid; | ||
border-width: thin; | ||
border-color: #007079; | ||
font-weight:bold; | ||
} | ||
|
||
.webviz-label { | ||
font-size: 15px; | ||
} | ||
|
||
.webviz-label-bold { | ||
font-size: 15px; | ||
font-weight:bold; | ||
} |
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,3 @@ | ||
.webviz-block-options > label, legend { | ||
display: block; | ||
} |
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,11 @@ | ||
.webviz-selectors { | ||
cursor: pointer; | ||
color: #555; | ||
margin-top: 20px; | ||
margin-bottom: 10px; | ||
|
||
} | ||
|
||
.webviz-selectors:hover { | ||
box-shadow: 0px 0px 3px 0.5px lightgrey; | ||
} |
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,26 @@ | ||
/* !Important is needed to take precedence of the .rc-slider classes */ | ||
|
||
.webviz-slider .rc-slider-track { | ||
background-color: var(--menuLinkColor) !important; | ||
} | ||
|
||
.webviz-slider .rc-slider-dot-active { | ||
border-color: var(--menuLinkHoverColor) !important; | ||
border-color: var(--menuLinkHoverColor) !important; | ||
} | ||
|
||
.webviz-slider .rc-slider-handle { | ||
background-color: var(--menuLinkHoverColor) !important; | ||
border-color: var(--menuLinkHoverColor) !important; | ||
} | ||
|
||
.webviz-slider .rc-slider-handle-active:active { | ||
border-color: var(--menuLinkHoverColor) !important; | ||
box-shadow: 0 0 5px var(--menuLinkHoverColor) !important; | ||
} | ||
|
||
.webviz-slider .rc-slider-dot { | ||
margin-left:-10px !important; | ||
background-color: var(--menuBackground) !important; | ||
border-color: var(--menuLinkHoverColor) !important; | ||
} |
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,16 @@ | ||
/* !Important is needed to take precedence over the inline styles set in the dcc.Tabs | ||
component https://github.com/plotly/dash-core-components/blob/dev/src/components/Tabs.react.js */ | ||
|
||
.webviz-tab { | ||
border-bottom: 1px solid #d6d6d6 !important; | ||
padding: 6px !important; | ||
font-weight: bold !important; | ||
} | ||
|
||
.webviz-tab-selected { | ||
border-top: 1px solid #d6d6d6 !important; | ||
border-bottom: 1px solid #d6d6d6 !important; | ||
background-color: #007079 !important; | ||
color: white !important; | ||
padding: 6px !important; | ||
} |
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,15 @@ | ||
/** | ||
* Copyright (c) 2021- Equinor ASA | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import "./Dropdown/dropdown.css"; | ||
import "./Frame/frame.css"; | ||
import "./Header/header.css"; | ||
import "./Label/label.css"; | ||
import "./RadioItems/radioitems.css"; | ||
import "./Selectors/selectors.css"; | ||
import "./Slider/slider.css"; | ||
import "./Tab/tab.css"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from .checklist import Checklist | ||
from .collapsive_header import CollapsiveHeader | ||
from .dropdown import Dropdown | ||
from .flexbox import FlexBox | ||
from .flexcolumn import FlexColumn | ||
from .frame import Frame | ||
from .graph import Graph | ||
from .header import Header | ||
from .label import Label | ||
from .range_slider import RangeSlider | ||
from .radioitems import RadioItems | ||
|
||
from .select_with_label import SelectWithLabel | ||
from .selectors import Selectors | ||
from .slider import Slider | ||
from .tab import Tab | ||
from .tabs import Tabs | ||
|
||
__all__ = [ | ||
"Checklist", | ||
"CollapsiveHeader", | ||
"Dropdown", | ||
"FlexBox", | ||
"FlexColumn", | ||
"Frame", | ||
"Graph", | ||
"Header", | ||
"Label", | ||
"RangeSlider", | ||
"RadioItems", | ||
"SelectWithLabel", | ||
"Selectors", | ||
"Slider", | ||
"Tab", | ||
"Tabs", | ||
] |
File renamed without changes.
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,64 @@ | ||
from typing import Any | ||
|
||
import dash_html_components as html | ||
import dash_core_components as dcc | ||
|
||
|
||
class Checklist(html.Div): | ||
"""A Div wrapping a dcc.Checklist with an | ||
optional label and toggle for vertical/horizontal layout. | ||
Keyword arguments: | ||
- label (string; optional): | ||
The text of the label | ||
- vertical (bool; default True): | ||
Position options vertically | ||
- className (string; optional): | ||
Additional css class to apply | ||
- wrapper_id (string; optional): | ||
Id of the wrapping div | ||
- persistence (boolean | string | number; default: True): | ||
Used to allow user interactions in this component to be persisted | ||
when the component - or the page - is refreshed. If `persisted` is | ||
truthy and hasn't changed from its previous value, a `value` that | ||
the user has changed while using the app will keep that change, as | ||
long as the new `value` also matches what was given originally. | ||
Used in conjunction with `persistence_type`. | ||
- persistence_type (a value equal to: 'local', 'session', 'memory'; default 'session'): | ||
Where persisted user changes will be stored: memory: only kept in | ||
memory, reset on page refresh. local: window.localStorage, data is | ||
kept after the browser quit. session: window.sessionStorage, data | ||
is cleared once the browser quit. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
label: str = None, | ||
vertical: bool = True, | ||
className: str = "", | ||
wrapper_id: str = None, | ||
persistence: bool = True, | ||
persistence_type: str = "session", | ||
**kwargs: Any | ||
) -> None: | ||
super().__init__() | ||
if wrapper_id is not None: | ||
self.id = wrapper_id | ||
children = [html.Label(label)] if label else [] | ||
children.append( | ||
dcc.Checklist( | ||
persistence=persistence, | ||
persistence_type=persistence_type, | ||
className=className + " webviz-block-options" | ||
if vertical | ||
else className, | ||
**kwargs, | ||
) | ||
) | ||
self.children = html.Div(style={"fontSize": "15px"}, children=children) |
29 changes: 29 additions & 0 deletions
29
webviz_core_components/wrapped_components/collapsive_header.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,29 @@ | ||
from typing import Any | ||
|
||
import dash_html_components as html | ||
|
||
|
||
class CollapsiveHeader(html.Details): | ||
"""Creates a collapsible box with a large header label. | ||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; required): | ||
The children of this component. | ||
- open_details (bool; default True): | ||
Used to set initial opened/closed state | ||
- label (str; optional): | ||
The text of the label | ||
""" | ||
|
||
def __init__( | ||
self, children: Any, open_details: bool = True, label: str = "", **kwargs: Any | ||
) -> None: | ||
super().__init__(**kwargs) | ||
self.open = open_details | ||
self.children = [ | ||
html.Summary(children=label, className="webviz-header") | ||
] + children |
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,30 @@ | ||
from typing import Any | ||
|
||
import dash_html_components as html | ||
import dash_core_components as dcc | ||
|
||
|
||
class Dropdown(html.Div): | ||
def __init__( | ||
self, | ||
label: str = None, | ||
wrapper_id: str = None, | ||
persistence: bool = True, | ||
persistence_type: str = "session", | ||
**kwargs: Any, | ||
) -> None: | ||
super().__init__() | ||
if wrapper_id is not None: | ||
self.id = wrapper_id | ||
children = [html.Label(label)] if label else [] | ||
children.append( | ||
html.Div( | ||
className="webviz-dropdown", | ||
children=dcc.Dropdown( | ||
persistence=persistence, | ||
persistence_type=persistence_type, | ||
**kwargs, | ||
), | ||
) | ||
) | ||
self.children = html.Div(style={"fontSize": "15px"}, children=children) |
File renamed without changes.
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,38 @@ | ||
from typing import Union, Any | ||
import dash_html_components as html | ||
|
||
|
||
class FlexColumn(html.Div): | ||
"""Used as a child of wcc.Flexbox to arrange components in a grid. | ||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; required): | ||
The children of this component. | ||
- flex (int, str; default 1): | ||
The fraction of width this component will have | ||
- min_width (str; optional): | ||
The minimum width before the component will rearrange to a new row | ||
- style (string; optional): | ||
Additional css class to apply | ||
""" | ||
|
||
def __init__( | ||
self, | ||
children: Any, | ||
flex: Union[str, int] = 1, | ||
min_width: str = None, | ||
style: dict = None, | ||
**kwargs: Any, | ||
) -> None: | ||
super().__init__(**kwargs) | ||
style = style if style else {} | ||
style.update({"flex": flex}) | ||
if min_width is not None: | ||
style.update({"minWidth": min_width}) | ||
self.style = style | ||
self.children = children |
Oops, something went wrong.