MCPcopy Create free account
hub / github.com/plotly/dash / to_plotly_json

Method to_plotly_json

dash/development/base_component.py:269–294  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

267 return v
268
269 def to_plotly_json(self):
270 # Add normal properties
271 props = {
272 p: getattr(self, p)
273 for p in self._prop_names # pylint: disable=no-member
274 if hasattr(self, p)
275 }
276 # Add the wildcard properties data-* and aria-*
277 props.update(
278 {
279 k: getattr(self, k)
280 for k in self.__dict__
281 if any(
282 k.startswith(w)
283 # pylint:disable=no-member
284 for w in self._valid_wildcard_attributes
285 )
286 }
287 )
288 as_json = {
289 "props": props,
290 "type": self._type, # pylint: disable=no-member
291 "namespace": self._namespace, # pylint: disable=no-member
292 }
293
294 return as_json
295
296 # pylint: disable=too-many-branches, too-many-return-statements
297 # pylint: disable=redefined-builtin, inconsistent-return-statements

Calls 1

updateMethod · 0.45