mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: create flowcharts from a generic element using elbow arrows (#8329)
Co-authored-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
dd1370381d
commit
54491d13d4
21 changed files with 1431 additions and 19 deletions
|
@ -377,6 +377,10 @@ class Scene {
|
|||
}
|
||||
|
||||
insertElementsAtIndex(elements: ExcalidrawElement[], index: number) {
|
||||
if (!elements.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Number.isFinite(index) || index < 0) {
|
||||
throw new Error(
|
||||
"insertElementAtIndex can only be called with index >= 0",
|
||||
|
@ -403,7 +407,11 @@ class Scene {
|
|||
};
|
||||
|
||||
insertElements = (elements: ExcalidrawElement[]) => {
|
||||
const index = elements[0].frameId
|
||||
if (!elements.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const index = elements[0]?.frameId
|
||||
? this.getElementIndex(elements[0].frameId)
|
||||
: this.elements.length;
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ export const exportToCanvas = async (
|
|||
// empty disables embeddable rendering
|
||||
embedsValidationStatus: new Map(),
|
||||
elementsPendingErasure: new Set(),
|
||||
pendingFlowchartNodes: null,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import type {
|
|||
SocketId,
|
||||
UserIdleState,
|
||||
Device,
|
||||
PendingExcalidrawElements,
|
||||
} from "../types";
|
||||
import type { MakeBrand } from "../utility-types";
|
||||
|
||||
|
@ -33,6 +34,7 @@ export type StaticCanvasRenderConfig = {
|
|||
isExporting: boolean;
|
||||
embedsValidationStatus: EmbedsValidationStatus;
|
||||
elementsPendingErasure: ElementsPendingErasure;
|
||||
pendingFlowchartNodes: PendingExcalidrawElements | null;
|
||||
};
|
||||
|
||||
export type SVGRenderConfig = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue