Skip to content

remove plottable_data #24

@eatyourpeas

Description

@eatyourpeas

The Measurement class returns a python object with 7 nested elements:
birth_data
measurement_dates
child_observation_value
measurement_calculated_values
bone_age
events_data
The 6th is plottable_data which has nested within it centile_data and sds_data, which in turn have nested inside them one each of chronological_decimal_age_data and corrected_decimal_age_data. The only really difference is that the decimal ages are mapped to x (depending on whether chronological or corrected) and the observation_value in the centiles, or the sds (again depending on chronological or corrected), maps to y . All the other parts are elsewhere in the object and were added there for convenience. It meant that the chart component could pull out all the elements it needed from the plottable_data object when plotting, rather than mapping different bits first.

In fact though it makes for a slightly complicated structure and it is not very DRY.

Removing plottable_data would be neater, and would make the API response object leaner and possibly faster (though arguably unlikely noticeably).

To implement this we would have to:

  1. bump the major version, since there maybe people out there that rely on this for their own chart implementations
  2. refactor the chart component to accommodate the change

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions