Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
RSvebeck
Specialist
Specialist

Conceptual integration with Vector Graphics and Raphael JavaScript Library

Hi


I'm working on a conceptual rapael integration extension for Qlikview which I plan to publish on the forum for everyones free re-use as soon as I have solved these two issues (see below).


My idea is to handle the vector graphics in the documents "source database" and let the extension draw vector paths based on that data in Qlikview.


I'm writing it so that almost anyone with some programing skills can undertand and take over for their own purposes.
(I try to put comments on all rows in my code... !)


I'm quite far in the process and already have a prototype that is working quite ok.


This template reads path data of Sweden in the load script, when the Extension activates it draws a map of Sweden with qlickable regions. It is now very easy to just replace the paths and regions of sweden into any other paths. Could be a map of the world, or a floor plan or whatever.

But ....

There are two annoying things that I can not get to work.
To be able to understand my issues, you need to download my .qar, install it and test it.(Everything required is in the qar)


1. I can't get the read from document variables to work. If I can get this to work, I can control to color setup of the extension object more dynamic. I have removed all attemts for this in this code since I don't get anwhere on this issue. Please guide me into the right direction.


2. There is a strange bug in my extension that I don't understand. If I select any region on my map -> exit the "Web mode" -> clear all selections Enter "Web mode" again  -> the complete map is not redrawn (ony the last selected region is drawn). Why? All dimensions are in the extension. I find this very strange. Seems like the extension object store selections in some way which is not fully connected to normal selections/deselections.


Best Regards, hope to get some assistance. I think this project will be useful for many installations of Qlikview.


Robert

Svebeck Consulting AB
15 Replies
Not applicable

Could you post a qvw file including your extension already configured?

RSvebeck
Specialist
Specialist
Author

Hi. The QvW is also included in the qar, but here is a copy of that. //Robert

Svebeck Consulting AB
RSvebeck
Specialist
Specialist
Author

Ok.


I have now got a little bit further. I have solved issue 1 and my model now can get data from my extension.
There was no need to use variables for this since It is better to use the text properties on the extension iteslf.


So now my project only have one issue which is this:


1. Click on the map to select a region. The region turns green and the selection is visible in the listbox.
2. Exit the "Web view mode"
3. Go back to "Web view mode"
4. See how the map now only has one region drawn, not the complete map as it was from the beginning.
5. See also that the "Current selection" box is clean, since I have a "myData.ClearSelections();".


The strange thing is that since I clear all selections, the full map should be drawn.


Attached is the new version with. If you look into this problem, please use this version instead of the previous one.


Hope someone can look into this issue.


Best regards


Robert

Svebeck Consulting AB
vidyut
Partner - Creator II
Partner - Creator II

Hi Robert,

I think the problem could be fixed by reworking on the drawCanvas method. When you come back after disabling/enabling the WebView, the MaxPath value changes to 1, and therefore you are redrawing only one region. It might be due to DOM being rebuilt after the disbling/enabling of WebView.

One easy solution would be to have the extension object based on {1} instead of {$} with a column showing the value selected as 1. So the Extension Object Straight Table could have all the rows , but an extra column with 1 only for those rows that are selected. Then you base your rendering of selected regions based on this column.

Just as a try I changed the Sum(Sales) to Sum({1}Sales) and then you do not lose any regions after the refresh, but lose the selection highlighting (which needs change as suggested).

Thanks for putting the extension. Great work.

Regards,

Vidyut

Not applicable

Another way would be to have a Text variable containing the geometric data without respect to the selection state.

Something like:

=Concat(aggr({1}Key & chr(9) & Path & chr(9) & Description, Key), chr(13))

This way you will be able to retrieve all the geometric data you need to draw your map, formatted to be easily read from the js code. Once you've done that, you'll just need to have Key as dimension and a single expression.

RSvebeck
Specialist
Specialist
Author

Thank you Vidyut for taking time to look into my issue.


I will work on your work around suggestions and see what I can do to solve it. This extension is supposed to be generic, dynamic and customizable so I would prefer not be forced into using {1} if the expression.


However in reality when users are using this solution, they will not switch between webview and not web view, so it is not a "big issue"  - but I still find it strange and it would be interesting if someone from Qliktech could look into this phenomena.


best Regards


Robert

Svebeck Consulting AB
RSvebeck
Specialist
Specialist
Author

Thats a creative solution !

Just wondering: How much information can a textvariable contain?

If I have "floorplan data" continging detailed paths of all rooms in a skyscraper buildning, or a high detailed world map with cities and egions -  there would be a lot of data that has to go into this textbox.

I'm also aiming this Extension to be able to hande several setups of paths so that depending on what gets selected in the data, different paths will be drawn.


Best Regards


Robert

Svebeck Consulting AB
Not applicable

This is great stuff Robert.  Many thanks for your effort.  We're finding it quite useful.

RSvebeck
Specialist
Specialist
Author

Hi. Nice to see that this is usefull! I've been busy with other projects for a month and haven't found the time to do much further development in this project, but I have done a solution where I store several sets of paths in the database and Qlikview will redraw a floormap depending on which "warehouse" I pick.

//Robert

Svebeck Consulting AB