Why does an arrow make a duplicate component in a PlantUML diagram? - plantuml

I'm very new to PlantUML, so this is likely something basic.
Sometimes when I add a arrow from one rectangle to another, the original component is not linked. Instead, a new component is created and linked. What am I doing wrong?
In my example, I have this fairly simple diagram:
#startuml
database "DB" {
frame Rules {
rectangle "Item 1"
rectangle "Item 2"
}
}
rectangle "App Server" {
rectangle "My UI"
}
rectangle "System" {
rectangle "Foo"
}
[My UI] --> [Item 1] : create and edit
[System] --> [Item 1] : extract
#enduml
And this is generated:
Note that the arrow from System to Item 1 is for a new component and not the existing "System" element.
What am I doing wrong?

I asked the same question in the PlantUML forum, and was told that this is due to the brackets around the name System in the arrows. I guess they can only be used if the name contains a space.
So replacing
[System] --> [Item 1] : extract
with
System --> [Item 1] : extract
fixes the issue, and creates this diagram:

Related

PlantUML - Long description with nest brackets

I'm trying to draw a long description square with nested components.
Something like
node mynode [
<<device>>
--
long description here
] {
artifact "a nested element"
}
The processor give me error until I remove the long description bracket (or viceversa, I decide to remove the nested element). Therefore, if both elements are presents, some problems occurs.
If simple text long description is enough, then you can just put description in quotation marks and use alias:
database "Some long description" as oracle1 {
storage data
}
actor user
user --> oracle1
If more complex description is required then you can use nested diagrams. But in this case you can't link elements of nested diagrams with elements of the outer diagram.
rectangle rect1 [
Long long description
---
Some more
===
{{
rectangle nested1
rectangle nested2
nested1 --> nested2
}}
]
rectangle rect2
rect1 ---> rect2
How about this:
#startuml
node "<<device>>\n----\nlong description here" as mynode {
artifact "a nested element"
}
#enduml

How to change the border color of loop group in plantuml?

See, I have a loop in plantuml
loop
etl -> kafka:
kafka -> linda:
linda --> kafka:
kafka --> etl:
end
Now I want to change the border color of loop group from Black to DodgerBlue, neither
skinparam sequence {
SequenceGroupBorderColor DodgerBlue
}
nor
skinparam loop {
SequenceGroupBorderColor DodgerBlue
}
works, the documentation work of PlantUML is so poor, I can hardly find any detail things, how to deal with this work?
The following does work for me:
skinparam Sequence {
GroupBorderColor #ff0000
}
and
skinparam {
SequenceGroupBorderColor #ff0000
}
To get all possible skin parameters use:
java -Djava.awt.headless=true -jar plantuml.jar -language
and browse through the result.
See http://plantuml.com/skinparam for a small (incomplete) description of the skin parameters.
Edit: My initial: "Looks a bit like the color mnemonics don't work (maybe raise an issue at https://forum.plantuml.net/ask)" is not correct. I must have made a typo somewhere. retried with the comment from OP and it did work with DodgerBlue.

Manipulate SQL Server spatial data

I have a table containing a map. The data looks like this
select
location.ToString()
from
mp_ices_areas
where
ICES_AREA in ('IIIa', 'IVa', 'IVb')
results in this:
POLYGON ((11.45850012 58.98790008, 11.4651 58.98660003, ...
POLYGON ((7.00000056 58.05548352, 7.00010064 58.05550053, ...
etc.
The map have been updated, so the "step looking" border is now a straight line. This is visualized using this query:
DECLARE #g1 geography = 'LINESTRING (7.0480147 57.982986, 8.598667 57.112833)';
select
location.STUnion(#g1)
from
mp_ices_areas
where
ICES_AREA in ('IIIa', 'IVa', 'IVb')
Original map with new border line
The result should be like this:
Corrected map
What needs to be done:
If you look at the first picture then the border beween the three areas (blue, purple and orange) looks like a staircase.
The areas needs to be changed so that this border between these three areas follows the thin red line instead (I tried to visualize the wanted result in the last picture).
I have coordinates of the red line (start and end point), so it must be possible somehow to make some SQL that could either update the geography object or help me manually create a new WKT string.

How to highlight all matched word in single snippet in solr

All:
Right now, I am using SOLR highlight feature, but one thing I want to ask is:
Suppose I want to search keyword fund and value:
fund AND value
And the return highlight part is like:
"highlighting": {
"blk_0019": {
"content": [
"philosophy of the <em>fund</em> – <em>value</em> and turning point. \n \n MUSA was an orphaned"
]
},
"blk_0006": {
"content": [
"Global Equities <em>Fund</em> Ltd. \n \n CONFIDENTIAL enclosed"
]
}
}
The problem is I am sure blk_0019 and blk_0006 have both fund and value(obviously I use fund AND report), because the I set hl.fragsize=100, if the fund and value located not close enough in one document, they can not be shown both in same snippet. In blk_0019, solr highlights both fund and value, but in blk_0006, only fund shown.
How can I show both matched in single snippet and just ignore text between them as ..... like in Google
Also some small questions are:
[1] How to specify to search capitalized only word like Hello HELLO
in Solr?
[2] How to search All-capital AND(All-capital "AND" will be consider as logical operator)
Thanks
It depends on the highlighter you are using. For the Standard Highlighter you can set hl.snippets=5 for instance (default is 1). Then you'll get 5 snippets/fragments (at most), each with a maximum length of hl.fragsize.
They're returned as multiple values, so you'll need to join them yourself (using "..." for instance).

Selective coloring on dynamic TextBlock content in WPF

For selective coloring of static content the following suggestion works fine :
Is it possible to seletively color a wrapping TextBlock in Silverlight/WPF
However my content will be generated at runtime.
For ex. if the Content generated is : "A Quick Brown Fox"
Then I need they string "Brown" to be in color Brown and "Fox" to be in color Red
The Keyword-Color list is fixed and available to me at runtime.
I have looked at the Advanced TextFormatting page on MSDN, but it is too complicated for me, also the sample in there does not compile :(
I am looking at creating a custom control which can do this for me. Let me know if anyone has any idea regarding how to go about this.
Thanks in advance.
The idea is explained in your link: Have a property for the text in the custom control. Then scan the text for the words, and create appropriate Runs. In the end, assign them all to the TextBox inlines collection.
In this example I simply used string.Split(). You might miss words if they are split by other punctuation.
Dictionary<string, Brush> colorDictionary;
string text; // The value of your control's text property
string[] splitText = text.Split(' ', ',', ';', '-');
foreach (string word in splitText)
{
if (string.IsNullOrEmpty(word))
{
continue;
}
Brush runColor;
bool success = colorDictionary.TryGetValue(word, out runColor);
if (success)
{
Run run = new Run(word);
run.Background = runColor;
textbox.Inlines.Add(run);
}
else
{
Run run = new Run(word);
texbox.Inlines.Add(run);
}
}

Resources