mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[charts] Allow skipping tooltip render

Open alexfauquette opened this issue 7 months ago • 2 comments

I did a test with the following component. Seems good

function TestTTooltip() {
  const tooltipData = useItemTooltip();

  return tooltipData === null ? (
    <text x={200} y={200} fill="red">
      NULL
    </text>
  ) : (
    <ChartsTooltipContainer trigger="item">
      <CustomItemTooltip />
    </ChartsTooltipContainer>
  );
}

Fix #18035

alexfauquette avatar May 28 '25 14:05 alexfauquette

Deploy preview: https://deploy-preview-18050--material-ui-x.netlify.app/

Updated pages:

Bundle size report

Total Size Change:${\tiny{\color{red}▲}}$+2.87KB(+0.02%) - Total Gzip Change:${\tiny{\color{red}▲}}$+1.17KB(+0.03%) Files: 120 total (0 added, 0 removed, 16 changed)

@mui/x-charts-pro/Heatmapparsed:${\tiny{\color{red}▲}}$+383B(+0.21%) gzip:${\tiny{\color{red}▲}}$+99B(+0.16%)

Show 15 more bundle changes

@mui/x-chartsparsed:${\tiny{\color{red}▲}}$+180B(+0.07%) gzip:${\tiny{\color{red}▲}}$+97B(+0.12%) @mui/x-charts-proparsed:${\tiny{\color{red}▲}}$+180B(+0.05%) gzip:${\tiny{\color{red}▲}}$+99B(+0.10%) @mui/x-charts/ChartsTooltipparsed:${\tiny{\color{red}▲}}$+179B(+0.24%) gzip:${\tiny{\color{red}▲}}$+67B(+0.26%) @mui/x-charts-pro/BarChartProparsed:${\tiny{\color{red}▲}}$+162B(+0.08%) gzip:${\tiny{\color{red}▲}}$+60B(+0.09%) @mui/x-charts-pro/FunnelChartparsed:${\tiny{\color{red}▲}}$+162B(+0.08%) gzip:${\tiny{\color{red}▲}}$+93B(+0.14%) @mui/x-charts-pro/LineChartProparsed:${\tiny{\color{red}▲}}$+162B(+0.07%) gzip:${\tiny{\color{red}▲}}$+68B(+0.09%) @mui/x-charts-pro/PieChartProparsed:${\tiny{\color{red}▲}}$+162B(+0.09%) gzip:${\tiny{\color{red}▲}}$+61B(+0.10%) @mui/x-charts-pro/RadarChartProparsed:${\tiny{\color{red}▲}}$+162B(+0.10%) gzip:${\tiny{\color{red}▲}}$+63B(+0.12%) @mui/x-charts-pro/ScatterChartProparsed:${\tiny{\color{red}▲}}$+162B(+0.08%) gzip:${\tiny{\color{red}▲}}$+60B(+0.09%) @mui/x-charts/BarChartparsed:${\tiny{\color{red}▲}}$+162B(+0.09%) gzip:${\tiny{\color{red}▲}}$+67B(+0.12%) @mui/x-charts/LineChartparsed:${\tiny{\color{red}▲}}$+162B(+0.09%) gzip:${\tiny{\color{red}▲}}$+74B(+0.12%) @mui/x-charts/RadarChartparsed:${\tiny{\color{red}▲}}$+162B(+0.10%) gzip:${\tiny{\color{red}▲}}$+66B(+0.13%) @mui/x-charts/ScatterChartparsed:${\tiny{\color{red}▲}}$+162B(+0.10%) gzip:${\tiny{\color{red}▲}}$+54B(+0.10%) @mui/x-charts/SparkLineChartparsed:${\tiny{\color{red}▲}}$+162B(+0.09%) gzip:${\tiny{\color{red}▲}}$+68B(+0.12%) @mui/x-charts/PieChartparsed:${\tiny{\color{red}▲}}$+161B(+0.10%) gzip:${\tiny{\color{red}▲}}$+75B(+0.14%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against ee387874cd26b791375c8c5e956dc69953bb8eb8

mui-bot avatar May 28 '25 14:05 mui-bot

CodSpeed Performance Report

Merging #18050 will not alter performance

Comparing alexfauquette:fix-tooltip-early-return (ee38787) with master (3e8ecda)

Summary

✅ 9 untouched benchmarks

codspeed-hq[bot] avatar May 28 '25 14:05 codspeed-hq[bot]

@alexfauquette this should be ready for review

JCQuintas avatar Jun 02 '25 16:06 JCQuintas