-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'px_special_inputs' into wide_form2
- Loading branch information
Showing
4 changed files
with
118 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class IdentityMap(object): | ||
""" | ||
`dict`-like object which acts as if the value for any key is the key itself. Objects | ||
of this class can be passed in to arguments like `color_discrete_map` to | ||
use the provided data values as colors, rather than mapping them to colors cycled | ||
from `color_discrete_sequence`. This works for any `_map` argument to Plotly Express | ||
functions, such as `line_dash_map` and `symbol_map`. | ||
""" | ||
|
||
def __getitem__(self, key): | ||
return key | ||
|
||
def __contains__(self, key): | ||
return True | ||
|
||
def copy(self): | ||
return self | ||
|
||
|
||
class Constant(object): | ||
""" | ||
Objects of this class can be passed to Plotly Express functions that expect column | ||
identifiers or list-like objects to indicate that this attribute should take on a | ||
constant value. An optional label can be provided. | ||
""" | ||
|
||
def __init__(self, value, label=None): | ||
self.value = value | ||
self.label = label |
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