Sankey amcharts nodes are not being aligned well - amcharts

So I'm working with amcharts v4 and Sankey diagram.
I'm trying a dataset that is quite simple but I have the node 500 and 652 on same level and causing some visual issues as in the picture below.
I've tryied to arrange differently the dataset but having same issue.
Anyone can help?
Is even possibile to reduce the links width in order to make it fit better? (tryied everything from SankeyLink but with no results)
[{from: '100', to: '200', value: 1},
{from: '200', to: '450', value: 1},
{from: '450', to: '652', value: 1},
{from: '450', to: '652', value: 1},
{from: '652', to: '500', value: 1},
{from: '652', to: '500', value: 1},
{from: '500', to: '650', value: 1},
{from: '500', to: '650', value: 1}]
enter image description here

So it seems to be a bug becouse all nodes have names that are all numbers.
Below the reply from amcharts responsable.
It seems to be a bug caused by all-number names. If I change the name of the last node to something that starts with a letter, the chart displays fine.

Related

Problems with temporal types like duration in of the wShortest aggregate function

I have v2.0 of Memgraph, seems like temporal types like duration can't be part of the wShortest aggregate function.
Here is my code:
MATCH (n) DETACH DELETE n;
CREATE
(storage {name: "storage", current_time: localtime("T11:00")}),
(tape {name: "tape"}),
(lto {name: "lto"}),
(archive1 {name: "archive1", opens: localtime("T10:00"), closes: localtime("T11:00")}),
(archive2 {name: "archive2", opens: localtime("T08:00"), closes: localtime("T10:00")}),
(archive3 {name: "archive3", opens: localtime("T13:00"), closes: localtime("T16:00")}),
(archive4 {name: "archive4", opens: localtime("T15:00"), closes: localtime("T19:00")}),
(storage)-[:Fetch {duration: duration("3H")}]->(tape),
(storage)-[:Fetch {duration: duration("1H")}]->(lto),
(tape)-[:Drive {duration: duration("2H")}]->(archive1),
(tape)-[:Drive {duration: duration("4H")}]->(archive2),
(lto)-[:Ride {duration: duration("5H")}]->(archive3),
(lto)-[:Ride {duration: duration("4H")}]->(archive)
;
Here is wShortest query:
MATCH (a {name: "storage"})-[edge_list *wShortest 10 (e, n | e.duration) fetch_time]->(b)
RETURN *;
The error that I get is Error: Query failed: Calculated weight must be numeric, got duration.
This was a bug that was fixed with Memgraph 2.1.0 release. In the changelog it says: Allow duration values to be used as weights in the Weighted Shortest Path query.

Tarantool Querying Questions

I have the following data structure format:
unix/:/var/run/tarantool/tarantool.sock> s:format()
---
- [{'name': 'id', 'type': 'unsigned'}, {'name': 'version', 'type': 'array'}, {'name': 'data',
'type': 'array'}]
...
And I have the following data already inside it:
unix/:/var/run/tarantool/tarantool.sock> s:select{}
---
- - [0, [[21, 'action123'], [12, 'actionXYZ'], [11, 'actionABC']], [['actionXYZ',
'SOME_JAVASCRIPT_CONTENT']]]
- [1, [[33, 'action123'], [12, 'baseXYZ'], [11, 'baseABC']], [['bas123', 'SOME_CSS_CONTENT']]]
...
I have read through the references and documentation and I'm a bit lost on completing the following:
What's the "WHERE" equivalent? ie. Select to find entries that have a version of 12
Not seeing applicable examples in
https://www.tarantool.io/en/doc/2.2/reference/reference_lua/box_space/#lua-function.space_object.select
List items with the field names (so I know what block I'm looking at). In a way, sort of like having "column headers" in your results in SQL.
I have named tuples in my format() - how can I see these names when I'm querying data?
{'name': 'id', 'type': 'unsigned'}, {'name': 'version', 'type': 'array'}, {'name': 'data',
'type': 'array'}]
Pretty print! (preferably yaml)
I tried using https://www.tarantool.io/en/doc/2.2/reference/reference_lua/yaml/ to wrap around my select statements, but nothing was working.
You need to use indexes for imperative effective queries, look here:
https://www.tarantool.io/en/doc/2.2/reference/reference_lua/box_space/#lua-function.space_object.create_index
https://www.tarantool.io/en/doc/2.2/reference/reference_lua/box_index/
use tuple:tomap():
https://www.tarantool.io/en/doc/2.2/reference/reference_lua/box_tuple/#lua-function.tuple_object.tomap
It depends on where do you want it pretty. You may have to tune yaml settings, or simply chain tomap calls:
tarantool> box.space.TEST:pairs():map(function(x) return x:tomap({names_only=true}) end):totable()
---
- - COLUMN1: 1
COLUMN2: a
- COLUMN1: 13
COLUMN2: a
- COLUMN1: 1000
COLUMN2: a

How to use a SplayTreeMap on Firebase snapshot dictionary in dart/Flutter?

I'm successfully getting data back through StreamBuilder and need to sort it. How can I sort a Map of my snapshot data by keys? Also, If you give an example of doing this my value that would help also. I think I want to do a SplayTreeMap, but if there is a better way please provide. Here is my dictionary...
{Vid2: {imageString: https://i.ytimg.com/vi/Amq-qlqbjYA/mqdefault.jpg, title: BLACKPINK - '마지막처럼 (AS IF IT'S YOUR LAST)' M/V, rank: 2, videoID: Amq-qlqbjYA}, Vid10: {imageString: https://i.ytimg.com/vi/KSH-FVVtTf0/mqdefault.jpg, title: EXO 엑소 'Monster' MV, rank: 10, videoID: KSH-FVVtTf0}, Vid6: {imageString: https://i.ytimg.com/vi/BVwAVbKYYeM/mqdefault.jpg, title: [MV] BTS(방탄소년단) _ DOPE(쩔어), rank: 6, videoID: BVwAVbKYYeM}, Vid3: {imageString: https://i.ytimg.com/vi/m8MfJg68oCs/mqdefault.jpg, title: [MV] BTS(방탄소년단) _ Boy In Luv(상남자), rank: 3, videoID: m8MfJg68oCs}, Vid4: {imageString: https://i.ytimg.com/vi/9pdj4iJD08s/mqdefault.jpg, title: BLACKPINK - '불장난 (PLAYING WITH FIRE)' M/V, rank: 4, videoID: 9pdj4iJD08s}, Vid1: {imageString: https://i.ytimg.com/vi/3s1jaFDrp5M/mqdefault.jpg, title: EPIK HIGH - 'BORN HATER' M/V, rank: 1, videoID: 3s1jaFDrp5M}, Vid8: {imageString: https://i.ytimg.com/vi/3QAcvc4Ysl0/mqdefault.jpg, title: LONNI - LA KPOP 2, rank: 8, videoID: 3QAcvc4Ysl0}, Vid5: {imageString: https://i.ytimg.com/vi/2ips2mM7Zqw/default.jpg, title: BIGBANG - 뱅뱅뱅 (BANG BANG BANG) M/V, rank: 5, videoID: 2ips2mM7Zqw}}
I would like to display it either by keys...
Vid1, Vid2, Vid3...
or by values like rank ie...
Vid1:rank "1", Vid2: rank "2", Vid3: rank "3"...
If the source is a map, this should do what you want:
final sorted = new SplayTreeMap<String,dynamic>.from(map, (a, b) => a.compareTo(b));
DartPad example

PouchDB: filtering, ordering and paging

Very similar to these two CouchDB questions: 3311225 and 8924793, except that these approaches don't allow partial matching. Having e.g. these entries:
[{_id: 1, status: 'NEW', name: 'a'},
{_id: 2, status: 'NEW', name: 'aab'},
{_id: 3, status: 'NEW', name: 'ab'},
{_id: 4, status: 'NEW', name: 'aaa'},
{_id: 5, status: 'NEW', name: 'aa'}]
and key
[status, name, _id]
There seems to be no way to
filter these entries by status (full string match) and name (partial string match ~ startsWith)
order them by id
paginate them
because of the partial string match on name. The high value unicode character \uffff that allows this partial match also causes to ignore the _id part of the key, meaning the resulting entries are not sorted by _id, but rather by status and name.
var status = 'NEW';
var name = 'aa'
var query = {
startkey: [status, name],
endkey: [status, name + '\uffff', {}],
skip: 0,
limit: 10
};
results in
[{_id: 5, status: 'NEW', name: 'aa'},
{_id: 4, status: 'NEW', name: 'aaa'},
{_id: 2, status: 'NEW', name: 'aab'}]
There is no option to sort in memory, as this would only sort the individual pages, and not the entire data set. Any ideas about this?

JaVers Diff Tool. Does PrettyPrint working?

Build jb
JaversBuilder jb = JaversBuilder.javers().withMappingStyle(MappingStyle.BEAN).withListCompareAlgorithm(ListCompareAlgorithm.LEVENSHTEIN_DISTANCE).withPrettyPrint(true)
and then
log.info(diff.prettyPrint())
gives
1. ListChange{globalId:'fn.dsl.diff.javers.Instance/Folder:{0F1E2D3C-4B5A-6978-8796-A5B4C3D2E1F0}', property:'permissions', containerChanges:[(3).removed:'fn.dsl.diff.javers.Permission {type: 'ALLOW', mask: '135159', GN: 'entos_users_tst#tn.fntst.ru', GT: 'GROUP', source: 'DIRECT', depth: 'THIS_OBJECT_ONLY' }', (2).'fn.dsl.diff.javers.Permission {type: 'ALLOW', mask: '999415', GN: 'entos_admins_tst#tn.fntst.ru', GT: 'GROUP', source: 'DIRECT', depth: 'THIS_OBJECT_ONLY' }' to 'fn.dsl.diff.javers.Permission {type: 'ALLOW', mask: '135159', GN: 'entos_users_tst#tn.fntst.ru', GT: 'GROUP', source: 'DIRECT', depth: 'THIS_OBJECT_ONLY' }']}
, but expected pretty formatting. Like in docs - http://javers.org/documentation/diff-examples/#compare-valueobjects
System.out.println(diff);
//.. shouldDetectBossChange()
Diff:
1. ReferenceChange{
globalId:'org.javers.core.examples.model.Employee/Great Developer',
property:'boss',
oldRef:'org.javers.core.examples.model.Employee/Manager One',
newRef:'org.javers.core.examples.model.Employee/Manager Second'}
2. ListChange{
globalId:'org.javers.core.examples.model.Employee/Manager Second',
property:'subordinates',
containerChanges: [(0).added:'org.javers.core.examples.model.Employee/Great Developer']}
3. ListChange{
globalId:'org.javers.core.examples.model.Employee/Manager One',
property:'subordinates',
containerChanges:[(0).removed:'org.javers.core.examples.model.Employee/Great Developer']}
What am I do wrong?
Should I expect pretty formatting as showed in docs or it was formatted manually?
In the doc you are referring to, line breaks was added manually.
diff.toString() and diff.prettyPrint() (as it's only the alias)
adds br after each change.
So even ListChange with a series of ElementChanges is printed in a single line.
Use ChangeProcessor
to customize your diff formatting. See SimpleTextChangeLog example

Resources