Connecting Visio diagram to Sharepoint web part(s)

Started by sax symbol, February 17, 2021, 07:59:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sax symbol

Greetings Visio Gurus,

I'm designing an interactive seating chart/floorplan for the office and I would like to be able to show employee information in a Sharepoint web part when clicking on chair/desk shape in the Visio floorplan. I know it would involve connecting webparts, but not sure how the Visio diagram could be connected (hyperlinks?) We currently have Sharepoint 2016 and Visio 2016 but look to migrate to Office 365 "very soon". I'm not sure if the solution would be affected by the upgrade but I wouldn't like to change much. Any assistance would be appreciated. If you need any more information, please let me know.

Nikolay

#1
If you don't really care about web parts, you could consider my solution (you can still "publish" to SharePoint, there is a button to do that).
Have a look at the "Pokemon Office" example (the sidebar is also customizable, just this demo has the stock one):

https://nbelyh.github.io/svgpublishdemo/demo/PokemonBldgPlan.html

Known limitations:
- requires "script" permission on the site. This is NOT default for the "modern" (aka SharePoint Online) sites.
- requires manual re-export when diagram changes.

I have also built a web part to show Visio diagram here. It is the only one available in the Microsoft App Store, as far as I know (for modern pages).

Unfortunately, it looks like it's a bit complicated to install (you'll need help from your IT admin to be able to install it).
It's incredible how non-trivial it is to install SharePoint stuff from AppSource marketplace! Others make VIDEO guides for admins (!) what to approve and where. Amazing. Anyways:
The web part: https://appsource.microsoft.com/en/product/office/WA200002491
The article about it: https://unmanagedvisio.com/embed-visio-diagram-in-modern-sharepoint-pages/

Anyways, this SharePoint Marketplace (AppSource) thing looks more dead than alive now, Teams and Office Marketplaces look much better.

The source code is here (you can add data connections to it if you want to), and feed them to something.
https://github.com/nbelyh/VisioOnlineSpfxWebPart

Visisthebest

sax Nikolay's svg/html export software for Visio is highly recommended!
Visio 2021 Professional

sax symbol

Nikolay,

I first want to say that THIS IS AWESOME!! I've been trying to figure out how to do something like that for almost two years, since I've started this journey. I had some success adding linked data fields to screen tips it was inconsistent and it didn't function in the Visio web part. I've also tried adding the linked fields to callouts, but it was clumsy and in a large seating chart it would get cluttered. I then thought about just having a set location on the Sharepoint page update with personnel information when the seat is clicked, which is something that I saw from an older You Tube video. That is what led me here (this time), but I never imagined I'd find this solution, so thank you.

I have two concerns (actually one major and one minor concern): the minor concern is that we'd have to make sure that no security holes will be introduced with our implementation of the solution, a best practice for any code introduced to a system. It may take a while for them to get around to analyzing it, not a big problem. My second concern: you're listed as a hero member, which I highly concur with, especially if I can implement your solution to our application. The thing is, I'm considered the "hero" member when it comes to Visio in the office. They thought it was magical when I linked external data to shapes and made names appear next to desks and change when the employee's seat location was updated (what kind of mad sorcery is this??  :) ). Most of posters that I've have seen have probably forgotten more about Visio than I have learned in the last two years. I say all of that to ask, how difficult is this to implement for someone who knows just enough to be dangerous? I don't want to hurt myself or anyone else in my efforts  ;) I will play around with it for a while to see what I can do but I hope I don't fall over a cliff!  :D

Nikolay

#4
The exported data stays either locally or in the organization, there is no "online". No data is sent outside your organization (or outside your computer if you export locally).
It can be as simple as .HTML file exported (that's what many customers use actually). The SharePoint button just uploads that HTML (well, .aspx) file to your SharePoint site.

You can even simply turn off the internet and go offline, the export would still work, there is no need to "trust my words" :D

There is "export to GitHub" button though (it uploads the HTML file to YOUR GitHub account), that would make the exported data available to anybody who can see data from your GitHub.
If your GitHub is public, that's everyone. But that's intentional action, this is how the sample is made in the previous post for example.

I think I did not quite get the second question though, I mean this: "How difficult is this to implement for someone who knows just enough to be dangerous"  ???

Do you mean, how easy it would be to clone the solution? Well it's not that complicated really, Visio does most of the job by doing SVG export, and that' the heavy part.
The JavaScript files used in the solution are open, you can find them here: https://github.com/nbelyh/svgpublish-templates (along with the issue tracker, btw).
Feel free to use them as a base for your solution.

Usually, the problem with building things is that somebody needs to sit down and write the code.
I mean, talking is cheap, but there are not that many who do, especially when doing something that can be useful not only for you and your company but anyone ;D
Although I don't make much profit on this thing actually, it's enough to support existing customers, the website, and do some improvements periodically.

Mostly I'm making money for living now by working on customer-specific projects (which are mostly unrelated to Visio, btw).
So feel free to go ahead and build something better than that, that's perfectly fine with me  ;D

Or maybe I misunderstood your question completely??

Visisthebest

Svg Publish really fills in some critical gaps in Visio functionality, and as it has matured (now even featuring very nice social media preview pictures!) Nikolay has really done a great job with Svg Publish!

Nikolay has become a key part of the Visio ecosystem with all his contributions.

As more users discover Svg Publish I think usage will grow, can't wait to find out what features Nikolay will add next!

https://unmanagedvisio.com/products/svg-publish/
Visio 2021 Professional

Nikolay

Thank you for the feedback, the solution has some fans, that makes me happy!
If there were some video tutorials and marketing materials it could have been much better, I guess.
But anyway... Visio usage is confidently going down the last decade, and so does the usage of solutions for it, it's o(2). Can't be helped, I guess.

Visisthebest

Users in Office 365 enterprise environments can since very recently (September 2020) buy Visio Plan 2 directly without going through the IT department (in big orgs that often takes 12+ months to get on the desktop). This is revolutionary and I think can get Visio on an uptrend again as more people in big organizations learn of this possibility.

(Self-service purchase capabilities for Visio)

We'll see am still a big believer in Visio Desktop.

Visio 2021 Professional

sax symbol

Nikolay,

Perhaps I wasn't clear on my second concern; what you have shown me is "magical" and it's getting high praise from other users, so it must be good. I'm just not sure how to get it to do what you did in your demo. It may be more obvious once it is downloaded. My web shop is working on getting it downloaded but are having some issues. Will it be obvious to know how this solution will take my floor plan and data and display it as shown in your demo? The "knows just enough to be dangerous" part comes in because I may be dangerous to myself and I'm afraid I may do something that will throw a wrench in to the whole project to make it crash  :-\ Maybe in another life I could build something half as good, but definitely not right now. I know that the Visio web part will be going away and you can simply embed your Visio diagram into your Sharepoint page, but hopefully it won't affect functionality. I really hope I can get this solution to work in our application and I greatly appreciate you sharing it  :)

Nikolay

#9
Hmm looks like sometimes I am having hard times trying to understand what you want to say, sorry about that ;D

Well, there are source diagrams (Visio files). Extension stores it's settings in the Visio file itself.
So you should be able just download any example, copy settings to your file and then export it with the same "goodies".
https://unmanagedvisio.com/products/svg-publish/html-export-demo/

The very basic steps are:

1. You create or open Visio diagram. Any diagram. (in your case, this must be floor-plan, as far as I understand.
If you already have it linked to Excel sheet, that's even better, then the extension should show properties automatically)

2. (optional) You add some "decorations" to it (such as sidebar information, tooltips, callouts).
There are checkboxes to define basics. By default, you'll already get something that is moderately reasonable (properties and links of connected shapes on the sidebar and tooltips taken from the "comment" field)
The basic options are documented here ("Basic options"): https://unmanagedvisio.com/products/svg-publish/html-export-options/

3. You Export the thing (click "Export to Disk" button). This will produce an HTML file (on your disk, you are prompted for location), and open it in the default browser.
You can check it out, play with some settings, re-export. When you are happy with it, you could try using "Export to SharePoint" button instead of "Export to Disk".
It should produce the same result, but as a SharePoint page (either a "modern" page, or a "classic" page, there is a switch to define page type)

If you want a bit richer experience (pictures, formatted text on sidebar and in the tooltips / callouts, colors) you need to use custom templates.
This is explained (to some degree) here ("Using custom templates"). Now (version 1.3+) it's better to some degree compared to the pictures in the article, as now you have live view or the results
https://unmanagedvisio.com/using-custom-templates-in-svgpublish/

BTW you can install it per-user to play with (you don't need admin permissions to do that), and the extension itself also does not require admin permissions (click on "Advanced" then "Install only for me")
If you are afraid of breaking something, you can install it under another user's account, play with it, and then remove that other user's account along with all data.
One caveat: I have a new code signing certificate. You (may) get the prompt "the program is not commonly downloaded" (blue "smart screen" protection) when installing.
You'll need to click "proceed" here, not "cancel". Then you should see my signature ("Signed by: Nikolay Belykh").

sax symbol

Umm . . . . I'm feelin' a bit stupid right now  ::)

Once I installed the plugin into Visio it was VERY intuitive as far as the capabilities. The "Template Help" button that redirected to an online help screen was very helpful. From there it was straightforward. I'm not sure if it's because that everything I've done on this project has been everything BUT easy, or if I've been quarantined in my apartment so long that I simply overlooked what was in front of me  :o

Moral: if all else fails, read the instructions :P

Thank you so much for your time and patience! I'm not sure if there is a rating/appreciation/thumbs up section in your profile, but if so I give you and this solution all of that times ten! It should be a regular part of Visio, IMHO! If you see me talking to a volleyball named "Wilson" then someone tell me to step away from the workstation and get some fresh air!  ;D

Visisthebest

Hi Nikolay,

I also learned something new, you wrote:

BTW you can install it per-user to play with (you don't need admin permissions to do that), and the extension itself also does not require admin permissions (click on "Advanced" then "Install only for me")

Does that mean that users on a corporate network can in principle install Office VSTO addins with only windows user rights? (of course install it only for them)?

Anything to be mindful if when developing addins so they can be installed under just user group rights? (apart from the obvious things that require admin rights of course)

Thank you very good to know!
Visio 2021 Professional

Visisthebest

" By default, all users can install any Office add-ins from any source."

https://www.compassitc.com/blog/microsoft-office-add-ins-is-there-any-reason-to-be-concerned

Wow didn't know thought admin rights required!
Visio 2021 Professional

Nikolay

Quote from: Visisthebest on February 19, 2021, 09:41:47 AM
BTW you can install it per-user to play with (you don't need admin permissions to do that), and the extension itself also does not require admin permissions (click on "Advanced" then "Install only for me")
Does that mean that users on a corporate network can in principle install Office VSTO addins with only windows user rights? (of course install it only for them)?

That depends on company policy actually. Theoretically admin can disable ANY installs (and even starting executables that are not pre-approved).

To be able to install VSTO per-user:
1. The installer should install the app in user's profile folder (NOT to the program files)
2. The installer should add registration data only to the user's registry hive.

Visisthebest

Thank you Nikolay good to hear this possibility is there, of course unless really strict security settings are used.
Visio 2021 Professional