Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
eed5652
Merge pull request #2 from maxGraph/development
gelvidge Jan 8, 2022
32f5c19
fix error caused by undefined in getSelectionCell
gelvidge Mar 15, 2022
b79ac4b
fixed anchors example
gelvidge Mar 22, 2022
1179e26
updated references style.edge to style.edgeStyle
gelvidge Mar 24, 2022
8546ca9
fixed swimlanes
gelvidge Mar 24, 2022
f7743a6
fixed bugs in orgchart example
gelvidge Mar 27, 2022
f117758
fixed collapse example
gelvidge Mar 27, 2022
fa6ee48
fixed tree story
gelvidge Mar 31, 2022
c9eb40e
fixed autolayout
gelvidge Mar 31, 2022
560a33a
fixed boundary
gelvidge Mar 31, 2022
eac9d3e
Fixed guides example
gelvidge Apr 14, 2022
ad616f0
Fixed Dragsource example
gelvidge Apr 15, 2022
a1abe79
Fixed stylesheet example
gelvidge Apr 15, 2022
0d789a0
cleaned up some debugging changes
gelvidge Apr 16, 2022
5278f8b
fixed helloports example
gelvidge Apr 22, 2022
fc8ed77
fixed orthogonal example
gelvidge Apr 22, 2022
2ec2d18
fixed portrefs example
gelvidge Apr 24, 2022
a6dba2f
fixed overlays example
gelvidge Apr 24, 2022
f98ee5e
fixed autolayout example
gelvidge Apr 24, 2022
c6a1299
fixed nw cell handle causing drag instead of resize
gelvidge Apr 24, 2022
ae11bc4
Merge branch 'development' into examples
gelvidge Apr 28, 2022
92b2d6a
fixed type check error
gelvidge Apr 28, 2022
7b6b959
Merge branch 'examples' of https://github.com/gelvidge/maxGraph into …
gelvidge Apr 28, 2022
51e7206
Merge pull request #4 from gelvidge/examples
gelvidge Apr 28, 2022
59f764e
fixed filename case and fixedpoints example
gelvidge May 3, 2022
0bdae3b
fixed contexticons example
gelvidge May 4, 2022
f93db32
fixed control example
gelvidge May 6, 2022
e2ae0aa
fixed hovericons example
gelvidge May 6, 2022
3369322
fixed images example
gelvidge May 6, 2022
89c5a95
fixed indicators example
gelvidge May 7, 2022
bf71b5c
fixed markers example
gelvidge May 16, 2022
62226e8
fixed dynamic loading example
gelvidge May 16, 2022
0e0dd57
fixed monitor example
gelvidge May 17, 2022
fd492e8
fixed permissions example
gelvidge May 17, 2022
d5e0492
fixed thread example
gelvidge May 17, 2022
a1b33cd
fixed validation example
gelvidge May 21, 2022
6ed6b97
Fixed visibility example
gelvidge May 23, 2022
1ee4326
Fixed DynamicToolbar example
gelvidge May 23, 2022
4213252
Fixed toolbar example
gelvidge May 23, 2022
4a63940
fixed editing example
gelvidge May 23, 2022
91d8190
fixed labels
gelvidge May 24, 2022
806506b
fixed perimeter example
gelvidge May 25, 2022
435859d
fixed secondlabel example
gelvidge May 25, 2022
4ddbdf5
fixed page breaks example
gelvidge May 29, 2022
88e68be
fixed window example
gelvidge May 30, 2022
43084be
fixed fileio example
gelvidge May 30, 2022
e92e7af
fixed user object example
gelvidge May 30, 2022
0822840
small random fixes
gelvidge May 30, 2022
68f4a86
Merge remote-tracking branch 'upstream/development' into development
gelvidge May 31, 2022
cbf2a1f
Merge branch 'examples' into development
gelvidge Jun 1, 2022
80f8a1d
file name updates
gelvidge Jun 1, 2022
bbc183a
file name updates
gelvidge Jun 1, 2022
9aae8fa
File casing updates
gelvidge Jun 1, 2022
cc91fda
fixed some bugs as aresult of styling change from string to object
gelvidge Jun 1, 2022
761fb3f
bug fixes
gelvidge Jun 1, 2022
d44b881
fixed typescript build error
gelvidge Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .vscode/launch.json
Empty file.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@lerna/filter-options": "^4.0.0",
"babel-loader": "^8.2.3",
"better-docs": "^2.3.2",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"file-loader": "^6.2.0",
"jsdoc": "^3.6.7",
Expand All @@ -46,4 +47,5 @@
"webpack-merge": "^5.8.0"
},
"sideEffects": true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra change

}
12 changes: 6 additions & 6 deletions packages/core/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ table.MaxWindow {
font-family: Arial;
font-size: 8pt;
}
td.mxWindowTitle {
td.MaxWindowTitle {
background: url(data:image/gif;base64,R0lGODlhFwAXAMQAANfX18rKyuHh4c7OzsDAwMHBwc/Pz+Li4uTk5NHR0dvb2+jo6O/v79/f3/n5+dnZ2dbW1uPj44yMjNPT0+Dg4N3d3ebm5szMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAXABcAAAWQICESxWiW5Ck6bOu+MMvMdG3f86LvfO/rlqBwSCwaj8ikUohoOp/QaDNCrVqvWKpgezhsv+AwmEIum89ocmPNbrvf64p8Tq/b5Yq8fs/v5x+AgYKDhIAAh4iJiouHEI6PkJGSjhOVlpeYmZUJnJ2en6CcBqMDpaanqKgXq6ytrq+rAbKztLW2shK5uru8vbkhADs=) repeat-x;
_background: url('../images/window-title.gif') repeat-x;
text-overflow: ellipsis;
Expand All @@ -56,27 +56,27 @@ td.mxWindowTitle {
padding-bottom: 6px;
color: black;
}
td.mxWindowPane {
td.MaxWindowPane {
vertical-align: top;
padding: 0px;
}
div.mxWindowPane {
div.MaxWindowPane {
overflow: hidden;
position: relative;
}
td.mxWindowPane td {
td.MaxWindowPane td {
font-family: Arial;
font-size: 8pt;
}
td.mxWindowPane input, td.mxWindowPane select, td.mxWindowPane textarea, td.mxWindowPane radio {
td.MaxWindowPane input, td.MaxWindowPane select, td.MaxWindowPane textarea, td.MaxWindowPane radio {
border-color: #8C8C8C;
border-style: solid;
border-width: 1px;
font-family: Arial;
font-size: 8pt;
padding: 1px;
}
td.mxWindowPane button {
td.MaxWindowPane button {
background: url(data:image/gif;base64,R0lGODlhCgATALMAAP7+/t7e3vj4+Ojo6OXl5e/v7/n5+fb29vPz8/39/e3t7fHx8e7u7v///wAAAAAAACH5BAAAAAAALAAAAAAKABMAAAQ2MMlJhb0Y6c2X/2AhjiRjnqiirizqMkEsz0Rt30Ou7y8K/ouDcEg0GI9IgHLJbDif0Kh06owAADs=) repeat-x;
_background: url('../images/button.gif') repeat-x;
font-family: Arial;
Expand Down
Binary file added packages/core/images/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/connector.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/dot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/fit_to_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/forbidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/lightbulb_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/pencil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/printer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/users3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/images/workplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/core/src/gui/MaxWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class MaxWindow extends EventSource {
minimizable: boolean=true,
movable: boolean=true,
replaceNode: HTMLElement | null=null,
style: string=''
style: string | undefined =undefined
) {
super();

Expand Down
23 changes: 20 additions & 3 deletions packages/core/src/serialization/Codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import MaxLog from '../gui/MaxLog';
import { getFunctionName } from '../util/StringUtils';
import { importNode, isNode } from '../util/domUtils';
import ObjectCodec from './ObjectCodec';
import GraphDataModel from '../view/GraphDataModel';
import Geometry from '../view/geometry/Geometry';
import Point from '../view/geometry/Point';

const createXmlDocument = () => {
return document.implementation.createDocument('', '', null);
Expand Down Expand Up @@ -339,6 +342,20 @@ class Codec {
* @param into Optional object to be decodec into.
*/
decode(node: Element, into?: any): any {


//****Edit note - there may be other classes needed here????******
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

const classMap = {
"GraphDataModel": GraphDataModel,
"Geometry": Geometry,
"Point":Point,
"Array": Array,
"Object": Object,
"Boolean": Boolean,



};
this.updateElements();
let obj = null;

Expand All @@ -347,11 +364,11 @@ class Codec {

try {
// @ts-ignore
ctor = window[node.nodeName];
ctor = classMap[node.nodeName]
if (ctor == undefined) console.log(node.nodeName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do proper Error management

} catch (err) {
// ignore
console.log(err)// ignore
}

const dec = CodecRegistry.getCodec(ctor);

if (dec != null) {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export type CellStateStyle = {
imageBorder?: ColorValue;
imageHeight?: number;
imageWidth?: number;
imageVerticalAlign?: VAlignValue;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For indicator only? There was no need for this in the original mxGraph code, why do we need this now?

indicatorColor?: ColorValue;
indicatorDirection?: DirectionValue;
indicatorHeight?: number;
Expand Down
16 changes: 16 additions & 0 deletions packages/core/src/util/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ export const mixInto = (dest: any) => (mixin: any) => {
}
};

//getBBox of SVG element before rendered in DOM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please write proper JSDoc


export function svgBBox (svgEl: SVGGElement){
let tempDiv = document.createElement('div')
tempDiv.setAttribute('style', "position:absolute; visibility:hidden; width:0, height:0")
document.body.appendChild(tempDiv)
let tempSvg = document.createElementNS("http://www.w3.org/2000/svg", 'svg')
tempDiv.appendChild(tempSvg)
let tempEl = svgEl.cloneNode(true)
tempSvg.appendChild(tempEl)
let bb = (<SVGGElement>tempEl).getBBox()
document.body.removeChild(tempDiv)
return bb

}

/**
* Returns the value for the given key in the given associative array or
* the given default value if the value is null.
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/util/cloneUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export const clone = function _clone(obj: any, transients: string[] | null=null,
i != ObjectIdentity.FIELD_NAME &&
(transients == null || transients.indexOf(i) < 0)
) {
if (!shallow && typeof obj[i] === 'object') {
if (!shallow && typeof obj[i] === 'object') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra change + formatting issue

clone[i] = _clone(obj[i]);
} else {
clone[i] = obj[i];
}
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions packages/core/src/util/styleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import Rectangle from '../view/geometry/Rectangle';
import Cell from '../view/cell/Cell';
import GraphDataModel from '../view/GraphDataModel';
import CellArray from '../view/cell/CellArray';
import {clone} from './cloneUtils'
import { CellStateStyle, CellStyle, NumericCellStateStyleKeys } from 'src/types';


/**
* Removes the cursors from the style of the given DOM node and its
* descendants.
Expand Down Expand Up @@ -438,9 +440,10 @@ export const setCellStyles = (

if (cell) {
const style = cell.getStyle();
style[key] = value;
const styleClone =clone(style)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing this?

styleClone[key] = value;

model.setStyle(cell, style);
model.setStyle(cell, styleClone);
}
}
} finally {
Expand Down Expand Up @@ -490,6 +493,7 @@ export const setStyle = (style: string | null, key: string, value: any) => {
next < 0 ? ';' : style.substring(next)
}`;
} else {

style = style.substring(0, index) + (next < 0 ? ';' : style.substring(next));
}
}
Expand Down
8 changes: 3 additions & 5 deletions packages/core/src/view/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,8 @@ class Graph extends EventSource {
const newParent = change.child.getParent();
this.view.invalidate(change.child, true, true);

if (
newParent &&
(!this.getDataModel().contains(newParent) || newParent.isCollapsed())
) {
if (newParent == null || !this.getDataModel().contains(newParent) || newParent.isCollapsed())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's review mxgraph original code or explain why you need to change the logic here.

{
this.view.invalidate(change.child, true, true);
this.removeStateForCell(change.child);

Expand Down Expand Up @@ -1370,7 +1368,7 @@ class Graph extends EventSource {
setAllowLoops(value: boolean) {
this.allowLoops = value;
}

/**
* Returns {@link recursiveResize}.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/view/GraphDataModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export class GraphDataModel extends EventSource {
* @param {Cell} cell that represents the possible layer.
*/
isLayer(cell: Cell) {
return this.isRoot(cell.getParent());
return cell != null && this.isRoot(cell.getParent());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If cell can be null or undefined, I think it's better change the method signature,
perhaps something like isLayer(cell?: Cell).

}

/**
Expand Down
38 changes: 19 additions & 19 deletions packages/core/src/view/GraphView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ export class GraphView extends EventSource {

if (cell) {
state = this.getState(cell);

if (state) {
if (state.invalid) {
state.invalid = false;
Expand Down Expand Up @@ -857,14 +857,14 @@ export class GraphView extends EventSource {
* @param state {@link CellState} to be updated.
*/
updateCellState(state: CellState) {
const absoluteOffset = state.absoluteOffset;
const origin = state.origin;
const absoluteOffset = state.absoluteOffset;
const origin = state.origin;

absoluteOffset.x = 0;
absoluteOffset.y = 0;
origin.x = 0;
origin.y = 0;
state.length = 0;
absoluteOffset.x = 0;
absoluteOffset.y = 0;
origin.x = 0;
origin.y = 0;
state.length = 0;

if (state.cell !== this.currentRoot) {
const parent = state.cell.getParent();
Expand All @@ -890,11 +890,11 @@ export class GraphView extends EventSource {

if (geo.relative && pState) {
if (pState.cell.isEdge()) {
const origin = this.getPoint(pState, geo);
const originP = this.getPoint(pState, geo);

if (origin) {
origin.x += origin.x / this.scale - pState.origin.x - this.translate.x;
origin.y += origin.y / this.scale - pState.origin.y - this.translate.y;
if (originP) {
origin.x += (originP.x / this.scale) - pState.origin.x - this.translate.x;
origin.y += (originP.y / this.scale) - pState.origin.y - this.translate.y;
}
} else {
origin.x += geo.x * pState.unscaledWidth + offset.x;
Expand Down Expand Up @@ -1216,7 +1216,7 @@ export class GraphView extends EventSource {
pts.push((<Point[]>edge.absolutePoints)[0]);
const edgeStyle = this.getEdgeStyle(edge, points, source, target);

if (edgeStyle && source) {
if (edgeStyle) {
// target can be null
const src = this.getTerminalPort(edge, source, true);
const trg = target ? this.getTerminalPort(edge, target, false) : null;
Expand Down Expand Up @@ -1387,16 +1387,16 @@ export class GraphView extends EventSource {
*/
getFloatingTerminalPoint(
edge: CellState,
start: CellState,
start: CellState| null,
end: CellState | null,
source: boolean
) {
start = this.getTerminalPort(edge, start, source);
let next = this.getNextPoint(edge, end, source);

const orth = this.graph.isOrthogonal(edge);
const alpha = toRadians(start.style.rotation ?? 0);
const center = new Point(start.getCenterX(), start.getCenterY());
const alpha = toRadians(start?.style.rotation ?? 0);
const center = new Point(start?.getCenterX(), start?.getCenterY());

if (alpha !== 0) {
const cos = Math.cos(-alpha);
Expand Down Expand Up @@ -1427,7 +1427,7 @@ export class GraphView extends EventSource {
* @param terminal {@link CellState} that represents the terminal.
* @param source Boolean indicating if the given terminal is the source terminal.
*/
getTerminalPort(state: CellState, terminal: CellState, source: boolean = false) {
getTerminalPort(state: CellState, terminal: CellState|null, source: boolean = false) {
const key = source ? 'sourcePort' : 'targetPort';
const id = state.style[key];

Expand Down Expand Up @@ -1460,7 +1460,7 @@ export class GraphView extends EventSource {
* @param border Optional border between the perimeter and the shape.
*/
getPerimeterPoint(
terminal: CellState,
terminal: CellState|null,
next: Point,
orthogonal: boolean,
border = 0
Expand Down Expand Up @@ -2193,7 +2193,7 @@ export class GraphView extends EventSource {
}
};

this.endHandler = (evt: MouseEvent) => {
this.endHandler = (evt: MouseEvent) => {
if (
this.captureDocumentGesture &&
graph.isMouseDown &&
Expand Down
13 changes: 7 additions & 6 deletions packages/core/src/view/canvas/SvgCanvas2D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,10 @@ class SvgCanvas2D extends AbstractCanvas2D {
* Private helper function to create SVG elements
*/
roundrect(x: number, y: number, w: number, h: number, dx: number, dy: number) {
if (!this.node) return;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check original mxgraph implementation, I don't understand why we need to change the logic


this.rect(x, y, w, h); //creates this.node

this.rect(x, y, w, h);
if(!this.node)return

if (dx > 0) {
this.node.setAttribute('rx', String(this.format(dx * this.state.scale)));
Expand Down Expand Up @@ -1559,7 +1560,7 @@ class SvgCanvas2D extends AbstractCanvas2D {
tr += `rotate(${rotation},${this.format(x * s.scale)},${this.format(y * s.scale)})`;
}

if (dir != null) {
if (dir != '') {
node.setAttribute('direction', dir);
}

Expand Down Expand Up @@ -1819,9 +1820,9 @@ class SvgCanvas2D extends AbstractCanvas2D {
}

bbox = new Rectangle(
(x + 1) * s.scale,
x * s.scale,
(y + 2) * s.scale,
w * s.scale,
(w +1) * s.scale,
(h + 1) * s.scale
);
Comment on lines 1822 to 1827
Copy link
Copy Markdown
Member

@tbouffard tbouffard Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure the previous implementation cames from the orignal mxGraph.
There are a lot of place where there are +1 on position, width or height. It is very hard to do the review here. Unfortunately, I don't have time to dig into the 56 commits to find which example may need the change and how this change impacts other examples.

}
Expand All @@ -1835,7 +1836,7 @@ class SvgCanvas2D extends AbstractCanvas2D {
n.setAttribute('width', String(Math.ceil(bbox.width + 2)));
n.setAttribute('height', String(Math.ceil(bbox.height)));

const sw = s.fontBorderColor ? Math.max(1, this.format(s.scale)) : 0;
const sw = s.fontBorderColor !== 'none' ? Math.max(1, this.format(s.scale)) : 0;
n.setAttribute('stroke-width', String(sw));

// Workaround for crisp rendering - only required if not exporting
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/view/cell/TemporaryCellStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class TemporaryCellStates {

// Overrides doRedrawShape and paint shape to add links on shapes
if (getLinkForCellState != null) {
(<Graph>view.graph).cellRenderer.doRedrawShape = (state: CellState) => {
(<Graph>view.graph).cellRenderer.doRedrawShape = function(state: CellState) {
const shape = <Shape>state?.shape;
const oldPaint = shape.paint;

shape.paint = (c) => {
shape.paint = function (c) {
const link = getLinkForCellState(state);
if (link != null) {
c.setLink(link);
Expand All @@ -80,7 +80,7 @@ class TemporaryCellStates {
// Overrides validateCellState to ignore invisible cells
view.validateCellState = (cell, recurse) => {
if (cell == null || isCellVisibleFn == null || isCellVisibleFn(cell)) {
return (<Function>self.oldDoRedrawShape).apply(view, [cell, recurse]);
return (<Function>self.oldValidateCellState).apply(view, [cell, recurse]);
}
return null;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/view/geometry/edge/ConnectorShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ConnectorShape extends PolylineShape {

// Allow for stroke width in the end point used and the
// orthogonal vectors describing the direction of the marker
const filled = !(source ? this.style.startFill : this.style.endFill);
const filled = Boolean(source ? this.style.startFill : this.style.endFill);

result = MarkerShape.createMarker(
c,
Expand Down
Loading