PptxGenJS icon indicating copy to clipboard operation
PptxGenJS copied to clipboard

added connected lines for shapes

Open fred441a opened this issue 3 years ago • 6 comments

hi, i am aware of the other pull request by @lifejuggler. But seeing as how that is over a year old i thought i would just contribute again. i have updated some of @lifejugglers code to be able to merge into the newest master branch, and added a bit of a patch solution to id's

		if (slideItemObj.options != undefined) {
			if (slideItemObj.options.sId != undefined) {
				if (IDs.indexOf(slideItemObj.options.sId) > -1) {
					throw "ID is already in use, object / shape id cannot be the same for multiple objects / shapes";
				} else {
					IDs.push(slideItemObj.options.sId);
				}

			} else {
				if (IDs.indexOf(idx + 2) > -1) {
					throw "an sID used matched an automatically generated ID try using a higher number";
				} else {
					IDs.push(idx + 2);
				}

			}
		}

this at least throws an error if you have colliding id's, however i was wondering you you though it would be smarter to just automatically increment over already taken ids or if functions should return an automatically generated id to the user for them to use.

i also added an anchor enum that works at least for rectangular shapes. and added connectors to the shapes demo, like you asked.

i can also add connectors to other objects like tables or media, but i don't know if that is even somthing that we want?

should the user need to calculate their own position of of the connector arrows, or do we want this functionality built into the library? i can add this feature for squares at least.

i am very willing to help out with development of this feature if you just tell my what you think is best.

fred441a avatar Feb 02 '22 16:02 fred441a

This is a great and very important feature to have! Will it be available soon?

Hoogkamer avatar Feb 19 '22 08:02 Hoogkamer

Thanks @fred441a - can you provide sample usage code?

gitbrent avatar Feb 24 '22 01:02 gitbrent

i have added the connected lines for shapes functionallity to the shapes demo

fred441a avatar Feb 24 '22 06:02 fred441a

Would love to see this feature added soon. Anything I can do to help with this process?

f3ve avatar Feb 24 '22 18:02 f3ve

Why isn't that implemented?

Michael-Reich avatar Apr 26 '23 07:04 Michael-Reich