Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript function not recognized as a function in Dash AG Grid sparklines #329

Open
safroze-plotly opened this issue Oct 2, 2024 · 0 comments
Labels
bug something broken

Comments

@safroze-plotly
Copy link

safroze-plotly commented Oct 2, 2024

A client has reported an issue where the function key in the formatter property for the agSparklineCellRenderer is not being recognized as a JavaScript function in enterprise sparklines. Instead, it is interpreted as a string, which leads to incorrect behavior.
Some properties in AG Grid take a JavaScript function as inputs according to the doc here

The issue occurs when using the following configuration in the AG Grid;

{
  "cellRenderer": "agSparklineCellRenderer",
  "cellRendererParams": {
    "sparklineOptions": {
      "type": "bar",
      "formatter": {"function": "params.value[0] < 0 ? {fill: #5470c6} : {fill: #a90000}"},
      "valueAxisDomain": [-15, 15],
      "paddingOuter": 0,
      "padding": {
        "top": 0,
        "bottom": 0
      },
      "label": {
        "enabled": true,
        "fontWeight": "bold",
        "placement": "outsideEnd"
      }
    }
  }
}

Reference Links:

https://community.plotly.com/t/aggrid-agsparklinecellrenderer-and-formatter-params/84780

https://dash.plotly.com/dash-ag-grid/javascript-and-the-grid#functions

@safroze-plotly safroze-plotly added the bug something broken label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

1 participant