Skip to content

Commit cb56252

Browse files
committed
remove SrcValidator
1 parent d3c2587 commit cb56252

3 files changed

Lines changed: 1 addition & 30 deletions

File tree

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ to features in the release.
143143
If plotly.js adds new traces or trace/layout attributes that aren't listed in `orderings.json`, `get_plotschema.py` prints a warning like `missing key in attributes: <attribute-name>` and appends the missing entry to the end of its section. To resolve:
144144

145145
- Add each missing attribute to the appropriate section of `/_data/orderings.json` in the position you want it to appear in the reference docs.
146-
- When in doubt about trace-attribute placement, match plotly.js's native order: open the regenerated `_data/plotschema.json` and find where plotly.js itself places the attribute (e.g. inspect a representative trace's `attributes` keys in order). Following the native order keeps related attributes grouped (for example, `texttemplate``texttemplatefallback``texttemplatesrc`).
146+
- When in doubt about trace-attribute placement, match plotly.js's native order: open the regenerated `_data/plotschema.json` and find where plotly.js itself places the attribute (e.g. inspect a representative trace's `attributes` keys in order). Following the native order keeps related attributes grouped (for example, `texttemplate``texttemplatefallback`).
147147
- For new top-level layout attributes, group them with semantically related entries rather than appending to the end (for example, a new click-behavior attribute like `clickanywhere` belongs next to `clickmode`).
148148
- Re-run `python get_plotschema.py <PLOTLY.JS VERSION>` after editing `orderings.json` and confirm the warnings are gone.
149149
3. Rebuild the Algolia `schema` index with `ALGOLIA_API_KEY=<key> make update_ref_search`

_plotly_utils/basevalidators.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -667,33 +667,6 @@ def validate_coerce(self, v):
667667
return v
668668

669669

670-
class SrcValidator(BaseValidator):
671-
def __init__(self, plotly_name, parent_name, **kwargs):
672-
super(SrcValidator, self).__init__(
673-
plotly_name=plotly_name, parent_name=parent_name, **kwargs
674-
)
675-
676-
self.chart_studio = get_module("chart_studio")
677-
678-
def description(self):
679-
return """\
680-
The '{plotly_name}' property must be specified as a string or
681-
as a plotly.grid_objs.Column object""".format(plotly_name=self.plotly_name)
682-
683-
def validate_coerce(self, v):
684-
if is_none_or_typed_array_spec(v):
685-
pass
686-
elif isinstance(v, str):
687-
pass
688-
elif self.chart_studio and isinstance(v, self.chart_studio.grid_objs.Column):
689-
# Convert to id string
690-
v = v.id
691-
else:
692-
self.raise_invalid_val(v)
693-
694-
return v
695-
696-
697670
class NumberValidator(BaseValidator):
698671
"""
699672
"number": {

codegen/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ def name_base_validator(self) -> str:
411411
"""
412412
if self.path_str in CUSTOM_VALIDATOR_DATATYPES:
413413
validator_base = CUSTOM_VALIDATOR_DATATYPES[self.path_str]
414-
elif self.plotly_name.endswith("src") and self.datatype == "string":
415-
validator_base = "_plotly_utils.basevalidators.SrcValidator"
416414
elif self.plotly_name.endswith("dash") and self.datatype == "string":
417415
validator_base = "_plotly_utils.basevalidators.DashValidator"
418416
elif self.plotly_name == "title" and self.datatype == "compound":

0 commit comments

Comments
 (0)