In diagrams.net, create "connector with symbol" with custom shape - draw.io

Pretty recently, in the "General" section of shapes, the "connector with symbol" was added.
I was able to replace the email symbol with built-in shapes by editing the "Style" of the shape and setting shape=message to shape=cloud, for instance. But custom shapes (shapes in the Scratchpad) can't be referenced this way.
Now, how do I replace the pre-defined email symbol in the connector with a custom shape?
Example:

How and where did you create a custom shape? E.g if you take a custom shape described here:https://www.diagrams.net/doc/faq/custom-shapes, add it to canvas, press Ctrl+e to see the code, copy all shape related lines after "shape=" and paste it into e.g message shape, you should see message shape replaced with custom one.

Related

Is it possible to write a simple custom link that shows or hides all layers on a page?

I have a draw.io diagram page consisting of over 40 layers. But because I don't know which layers the user will have hidden/shown on the published diagram, I want to provide a button with an action set that hides all layers, then shows 3 specific layers.
Is it possible to hide all layers using a wildcard or similar, or do I need to manually create a huge (in manual management terms) layer id JSON array?
From what I can tell it's not possible, which surprises me, hence my asking. For my diagram it means I need to maintain huge JSON arrays in many links.
I've tried various custom links using cell and tag action wildcards, but my tests suggest tags only work for shapes (not layers), and cells includes both shapes AND layers.
data:action/json,{"actions":[{"hide":{"cells":["*"]}}]}
I hoped using the above custom link would cause all layers to be hidden, which it did, but it also caused shapes on the currently selected layer to be hidden. It also caused shapes on the currently selected layer to appear deleted within the editor, so I needed to use the Undo feature to get the shapes back. I guess this is a bug, unless I'm doing something wrong or my drawing has become corrupt.
Something like this would be a really useful feature:
data:action/json,{"actions":[{"hide":{"layers":["*"]}}]}
I would consider writing a plugin, but can't find any help documentation on the subject. Could someone advise on this?
It is possible to add tags to a layer. In order to do this, edit layer data (click on the layer, then on the three vertical dots) and add the "tags" property:
Add "tags" property to layer
Afterwards, you'll be able to add a tag to the layer like this:
Add tag "some_tag" to the layer
Now you can show or hide all layers with the tag some_tag with the following custom links:
Show all layers with some_tag:
data:action/json,{"actions":[{"show":{"tags":["some_tag"]}}]}
Hide all layers with some_tag:
data:action/json,{"actions":[{"hide":{"tags":["some_tag"]}}]}
I worked around the problem of not being able to hide all layers on a page via wildcard by using tags.
It's possible to tag individual shapes, or by grouping shapes and adding the tags property at the group level. So long as a shape or group has a "tags" property in the "Edit Data" screen with a value in it, it's possible to hide all by using the following custom link:
data:action/json,{"actions":[{"hide":{"tags":[""]}}]}
The same for showing all tags on a page:
data:action/json,{"actions":[{"show":{"tags":[""]}}]}
To show everything on a page without using tags it's possible to just use:
data:action/json,{"actions":[{"show":{"cells":["*"]}}]}
I also needed to add two buttons to an admin layer:
A "reset" button with "hide"/"show" custom link actions to reset the diagram to an initial state.
A "show all" button with "show" custom link actions to get all the shapes visible again, otherwise it wasn't possible to access them when editing the diagram.

How to make a QheaderView multilevel?

I am creating an application that saves the data of an object sending service.
I created that with Qt, a model of type QStandardItemModel that I want to display with QtableView.
But QtableView shows me the line level on the left. I want to delete it or hide it if possible.
I also have a problem with a header that I want to divide into two horizontally then divide the corresponding part of the bottom in two vertically. The reason for these division is that I have two headers with similar beginnings (date of correspondence and correspondence number)
Thank you for your reply because it is really important for me.
This type of QHeaderView does not exist, but we can create it for it we must create a class that inherits from QHeaderView and rewrite mainly the method paintSection which is the method in charge of drawing the sections of the QHeaderView.
But to do the generic project for any type of visual design we have to keep the information of the position and size of each section, for this we will create a model, to understand why of the overwritten classes I recommend you read content of the following link.
Explain the logic of each method is extensive so only place the link of the project that implements the above and describe the task of each class:
TableHeaderItem: It is responsible for saving the information of each item, mainly rowspan and columnspan in addition to the label.
GridTableHeaderModel: Model class that provides access to each item so that we can edit and read each item
GridTableHeaderView: This class is the custom QHeaderView where the main methods are overwritten to get the desired look.
GridTableView(optional): is a TableView that has methods to work directly with GridTableHeaderView.
Output:
Note: to hide the vertical header it is only necessary to use the hide() method:
horizontalHeader()->hide();

Scaffolding Components with Insertable Placeholders in Sitecore

I am trying to create a Sitecore site with a main Layout called _Main. The _Main layout has one Placeholder called Content.
I want to allow the author to insert components (Renderings, I guess) into this Placeholder. The components he will be allowed to insert will have names like...
Two_Column_Right
Two_Column_Left
One_Column
These are basically "scaffolding" components which, in turn, will have their own internal placeholders (e.g. RightRail, LeftRail, Center). The author will then be able to insert “real” components into these placeholders.
The goal is to allow the user to dynamically build the layout of the page.
My question is this: Will this work. Has anyone done it before? Will I need to use dynamic placeholders? Will this be possible using the Experience Editor?
Thanks!
This is a very common pattern of 'containers' which should definitely leverage dynamic placeholders. Otherwise, you will get into issues if you have two one-columns on a page and need to have a user add it to the correct one-column container.
So, so to your questions:
Yes it will work.
You should use dynamic placeholders or you will be severely limiting yourself and causing editors issues.
This can be done in Experience Editor, it is just a normal rendering after all.

Create interactive cartesian grid in django

I have a question regarding a platform I'm developing called e-cidadania (GPL). One of the applications will be something like a blackboard where you can put messages. I've been requested to do it like a cartesian grid (p.e. x = good/bad, y = expensive/cheap). My question is, does anybody know about an application like that for django? Or in case that there isn't, how can I do it? I have no idea where to start.
I'll explain a use case, if someone didn't understand: You are in a classroom, the teacher draws on the blackboard the axis and tells the students to write a note. After that every student will put his note according to the axis.
I am not sure if I completely understand your question, but if I'm correct you want the user to input text (name of restaurant or something like that) and instead of showing 2 sliders or dropdown boxes for rating and price, you want to show a cartesian chart where the user can click somewhere, thus entering the 2 values with one click.
This has nothing to do with Django or Python, this is pure client side. Think javascript. One way is to show an image with the cartesian grid, set an onclick handler and see where in the image the click was made. Showing the selected point could be done simply by setting a colored div with an absolute position (relative on the position of the image).
I don't know any plug-and-play solutions, but building this shouldn't be too hard.
On a separate note: I doubt this will actually be more userfriendly for the user then simply using two sliders.
Update:
Or if you want to show a big cartesian chart where the user actually has to input the text on the correct position, this can be done with the same idea: create the text-input, but hide it (display:none). Then when the user clicks somewhere on the chart, move the text-input to the correct position and show it.
This may be a little far fetched, but instead of doing this with django alone, why dont u do this client side using javascript?
Hear me out here.
The highcharts graphing plugin has an option that allows u to add points on a (cartesian) graph. Check this example. The plugin also allows you to display custom messages when hovering on points, so you could use that to display the actual message, and you could handle the actual saving of the new message by submitting the newly added message via Ajax.

Simple Question about Visio 2007 (trying to create a simple UML diagram(C++) )?

I'm simply trying to create a UML diagram where I can show the header file declarations.
I to be able to display things such as:
Bitmap * getImage()
Coordinate * getCoordinates(Object o)
Stuff like that. Problem is, I can't figure out how to display pointers as return types(it only let's be choose objects from the UML diagram) or arguments. I can get around the return types by just including them in the name of the function, but I still can't find out how to display the arguments (ex: Object o listed previously) or just find a quick fix around it. I can't quick fix it the same way because Visio automatically puts a parenthesis at the end of my function (ex: Coordinate * getCoordinates(Object o) would output Coordinate * getCoordinates(Object o)()
Is there a way to enter arguments and parameters that could include pointers? Or a quick fix around it?
Thanks in advance
Go to the method in question in the "Operations" area of the dialog box. Then click on the "Properties" button to get the "UML Operation Properties" dialog. In there, set the "suffix" to "*".