MCPcopy Index your code
hub / github.com/plotly/dash / create_prop_docstring_jl

Function create_prop_docstring_jl

dash/development/_jl_components_generation.py:284–333  ·  view source on GitHub ↗

Create the Dash component prop docstring Parameters ---------- prop_name: str Name of the Dash component prop type_object: dict react-docgen-generated prop type dictionary required: bool Component is required? description: str Dash compone

(
    prop_name,
    type_object,
    required,
    description,
    indent_num,
)

Source from the content-addressed store, hash-verified

282
283
284def create_prop_docstring_jl(
285 prop_name,
286 type_object,
287 required,
288 description,
289 indent_num,
290):
291 """
292 Create the Dash component prop docstring
293 Parameters
294 ----------
295 prop_name: str
296 Name of the Dash component prop
297 type_object: dict
298 react-docgen-generated prop type dictionary
299 required: bool
300 Component is required?
301 description: str
302 Dash component description
303 indent_num: int
304 Number of indents to use for the context block
305 (creates 2 spaces for every indent)
306 is_flow_type: bool
307 Does the prop use Flow types? Otherwise, uses PropTypes
308 Returns
309 -------
310 str
311 Dash component prop docstring
312 """
313 jl_type_name = get_jl_type(type_object=type_object)
314
315 indent_spacing = " " * indent_num
316 if "\n" in jl_type_name:
317 return (
318 "{indent_spacing}- `{name}` ({is_required}): {description}. "
319 "{name} has the following type: {type}".format(
320 indent_spacing=indent_spacing,
321 name=prop_name,
322 type=jl_type_name,
323 description=description,
324 is_required="required" if required else "optional",
325 )
326 )
327 return "{indent_spacing}- `{name}` ({type}{is_required}){description}".format(
328 indent_spacing=indent_spacing,
329 name=prop_name,
330 type="{}; ".format(jl_type_name) if jl_type_name else "",
331 description=(": {}".format(description) if description != "" else ""),
332 is_required="required" if required else "optional",
333 )
334
335
336# this logic will permit passing blank Julia prefixes to

Callers 2

shape_or_exactFunction · 0.85
create_docstring_jlFunction · 0.85

Calls 2

get_jl_typeFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…