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

How can I extend the original mxGraph prototype? #4

Open
awesomenkj opened this issue Jan 22, 2020 · 4 comments
Open

How can I extend the original mxGraph prototype? #4

awesomenkj opened this issue Jan 22, 2020 · 4 comments

Comments

@awesomenkj
Copy link

awesomenkj commented Jan 22, 2020

How can I extend the original mxGraph prototype?
Something like this.

mxGraph.prototype.pageBreakColor = '#c0c0c0';
....
 var graphUpdatePageBreaks = mxGraph.prototype.updatePageBreaks;
	
mxGraph.prototype.updatePageBreaks = function(visible, width, height)
{
	var useCssTranforms = this.useCssTransforms, scale = this.view.scale, 
		translate = this.view.translate;

	if (useCssTranforms)
	{
		this.view.scale = 1;
		this.view.translate = new mxPoint(0, 0);
		this.useCssTransforms = false;
	}
	
	graphUpdatePageBreaks.apply(this, arguments);
	
	if (useCssTranforms)
	{
		this.view.scale = scale;
		this.view.translate = translate;
		this.useCssTransforms = true;
	}
};
@tbouffard
Copy link

@rabpeter have you been able to fix you issue?
It seems that you have copied/adapted this repository to manage your own solution

@awesomenkj
Copy link
Author

@tbouffard Yep. I solved the problem with my own packages and published them on NPM.
https://www.npmjs.com/package/ts-mxgraph

@tbouffard
Copy link

@rabpeter cool, good news then.

I am aware of your package because I work on a project that have forked it (https://github.com/process-analytics/ts-mxgraph) to add missing mxGraph type defintions.
That's why I contacted you in awesomenkj/ts-mxgraph-typings#1 as I did with the asual/mxgraph-factory repository owner (see #9) to know if you would be interested in joining a dedicated community initiative to provide mxGraph type definitions through the DefinitelyTyped project.

@tbouffard
Copy link

@rabpeter hello are you still interested in or working on mxgraph typescript integration?
I would like to talk to you about awesomenkj/ts-mxgraph-typings#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants