Skip to content

Refactor computeChart function in chart state to be more functional and not recompute on every change #75

@emmacunningham

Description

@emmacunningham

Is your feature request related to a problem? Please describe.
Our current computeChart function is massive and produces many side effects, which makes it hard to write tests for. Further, any time computeChart is called, all computations are run again even if certain values have remained the same and may not need to be re-computed.

Describe the solution you'd like
We can consider reducing the side effects produced by this function and reduce the size of the function (moving logic and computations into additional functions which can be themselves tested). We can also consider ways to address partial (and not full) re-computing (memoization, transducers to chain transformations, etc.).

Describe alternatives you've considered

Additional context
n/a

Kibana Cross Issues
Add any Kibana related issues/feature requests here.

n/a

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present

Metadata

Metadata

Assignees

No one assigned

    Labels

    :dataData/series/scales related issueenhancementNew feature or requestreleasedIssue released publicly

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions