@tiptap-pro/extension-diagrams changelog

Changelog for @tiptap-pro/extension-diagrams

0.4.0

Minor Changes

  • A new chart that mixes percent values with amounts or plain numbers can now put the percent series on a second axis on the right, as a line. Before, they lay flat near 0. This applies to line and bar charts that are not stacked or horizontal and have no series placement yet, when insertChart, convertTableToChart or insertLinkedChart picks the chart type itself. A type you name is kept. updateLinkedTable now keeps series styles on the same columns when the header changes.
  • readDocxDiagrams and drawingToDrawio turn the shape groups of a Word file (.docx) into draw.io diagrams and SVG pictures, with every shape, connector, color and text where Word drew it.
  • Diagrams read from Word keep which theme color a fill or line uses, so a renderer can follow the document's theme and dark mode.
  • Added drawioLiteDiagramRenderer from @tiptap-pro/extension-diagrams/drawio-lite, which draws draw.io diagrams without the draw.io viewer, and drawioToSvg in /core to draw them on a server.
  • convertImageToDiagram turns an image that keeps a diagram in its flowDiagramSource attribute back into a diagram.
  • toPortableContent takes diagrams: 'keep' to leave flowDiagram nodes as they are, for a converter that writes diagrams itself. The copy it returns now shares every node that holds no chart or diagram with the document passed in.
  • Add findReadOnlyChartDataChange, so a server that writes the document without the editor can refuse changes to read-only chart data.
  • The editor now drops any change to the data of a chart linked to a read-only Data Source, also from AI Toolkits, custom code and paste. Use editor.storage.diagrams.isChartDataReadOnly({ pos }) to check before an edit.
  • Word shapes with their own outline, such as freeform shapes, keep that outline in the draw.io diagram and the SVG, instead of being drawn as boxes.
  • readDocxDiagrams and drawingToDrawio now also turn a Word drawing canvas into a draw.io diagram and an SVG, with its shapes, groups, pictures and its fill and outline.
  • Pictures inside a Word shape group are embedded in the draw.io diagram and the SVG. drawingToDrawio takes a new pictureUrl option to read them, and readDocxDiagrams reads them from the file.
  • readDocxDiagrams takes a pictureUrl option, so the pictures inside a Word group can point to uploaded files instead of being embedded as data: URLs.
  • Word shape groups keep every built-in Word shape, such as clouds, stars, callouts and block arrows, in the draw.io diagram and the SVG, instead of drawing them as boxes. Their text sits where Word puts it, and connectors stay attached to any connection point.
  • readDocxDiagrams now turns a Word SmartArt into a draw.io diagram and an SVG of the shapes Word drew for it. drawingToDrawio does the same when you pass the new partXml option.

Patch Changes

  • The ECharts and d3 Renderers now reserve the legend's room before they lay out the chart, to reduce overlap with the axis labels, the axis titles and the chart title. The legend wraps into rows and the plot gets smaller. A side legend that is too wide moves below the chart. In a chart too small for its legend and its axes, they can still overlap. toEChartsOption uses this layout when you pass the size in its new optional fourth argument. Without it, the room is estimated as before.
  • updateLinkedTable now keeps series styles and the chosen series on their table columns when the columns are reordered or narrowed, also together with a new header and in tables without one.
  • A Word shape that a turned group inside a stretched group shears keeps its sheared outline in the draw.io diagram and the SVG, and is no longer listed in skipped.
  • Include customer documentation in the published package.

0.3.1

Patch Changes

  • Add the missing TypeScript types for the chart conversion, figure size, chart layout and insertFromText commands.

0.3.0

Minor Changes

  • A series column keeps the number format its cells were written in, such as $0.4B or 42.50%. Value axis labels and tooltips use it in the ECharts and d3 Renderers, and reading a chart back as text, a grid or a table writes the values the same way.
  • excelSource is a Data Source provider for Excel workbooks in OneDrive or SharePoint, through Microsoft Graph. Charts linked to it keep the workbook's number formats.
  • insertWorkbookCharts inserts the charts of an Excel workbook (.xlsx) into the document, with their data, colors, titles, axes and number formats.
  • Numbers with a currency, a scale or a percent sign, such as $0.4B, 12 EUR and 42.5%, and negative numbers in parentheses, such as ($1.20), are read as numbers. A percent is read as a share, so 42.5% is 0.425.
  • Thousands separators such as 1,234.5 and 1.234,5 are read, and each column of pasted or typed rows is read as a whole: a cell like 2.5 makes 1,000 in the same column 1000, and mixed scales such as $1.2B and $400M are converted to the first one.
  • readWorkbookCharts reads the charts of an Excel workbook (.xlsx) as Chart Data and Chart Specs: type, series, the workbook's colors, titles, axis ranges, legend and number formats.
  • The right axis of a combo chart takes a title, a range and a step from spec.axes.y2, and updateChartAxis accepts axis: 'y2'. ECharts, d3 and the Word export draw them.
  • The built-in Data Source url-xlsx lets a chart follow a chart of an Excel workbook at a URL, without a sign-in.

Patch Changes

  • Rename renderer build files with an adapter- prefix to distinguish them from third-party libraries. Package import paths stay the same.

  • Excel import reads literal percent signs, scatter charts with their own x values and both axes, and workbooks with the 1904 date system correctly. A table's totals row is left out of a linked Excel table, and large workbooks are refused instead of filling memory.

    A lone comma before three digits, as in $1,200, is read as a thousands separator unless the column shows the comma as the decimal. Excel number formats that divide by a thousand with a comma are no longer turned into a suffix.

  • A dash, n/a or #N/A in a value cell is read as a missing value, so a table pasted from a spreadsheet becomes a chart instead of an error.

  • Chart syntax keeps the first data row when a {L} marker on it names the label column.

  • The title of a combo chart's right axis can be renamed in the picture, as the other axis titles can.

  • A native Word chart writes its values and value axes in the number format of each column, such as $0.4B or 42.50%.

  • Charts read from an Excel workbook keep the angle of their category labels, and long labels are turned by 45 degrees as Excel turns them.

0.2.0

Minor Changes

  • The Mermaid Renderer now supports Mermaid 12. The optional mermaid peer dependency is >=11.16.1 <13. Mermaid 12 lays out flowchart, state, class, ER and requirement diagrams with ELK, so these diagrams look different than with Mermaid 11. To keep the dagre layout, pass layout: 'dagre' to mermaidDiagramRenderer.
  • The Quick Input now shows why it stays open when its text cannot become a chart or a diagram, for example Line 3: "many" is not a number. Screen readers announce the message, and it goes away when you change the text. Text that the Quick Input used to turn into a chart of words, such as a word where a number belongs or broken Mermaid, draw.io or BPMN, now keeps the Quick Input open with such a message.

0.1.0

Minor Changes

  • Initial release of the Diagrams package: charts and flow diagrams in a Tiptap document, stored as data and drawn by a replaceable Renderer (ECharts, d3, Mermaid, Pele, draw.io, BPMN or your own).