Zooming with Visio Web Part in Sharepoint

Started by sax symbol, March 23, 2021, 07:17:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sax symbol

Visio Gurus,

I have encountered a problem with Visio Web Part for Sharepoint:  I have constructed a seating chart that has a lot of desks for the office. The diagram is such that you have to zoom to 1000% in order to read names on it, which is no problem within Visio 2016; however, when I use the the Visio web part in Sharepoint the limit is 200%, not enough to display any useful information for my application. We are due to migrate to Office 365 "shortly", and configurations will have to be changed due to the sunsetting of the Visio web part. Will this migration allow me to zoom into the diagram closer using the included apps or will I have to find another solution? We are currently using Sharepoint and Visio 2016. Any assistance is appreciated.

Nikolay

As far as I have tested right now, max zoom is 400% in the SharePint online.

Other than that you can always try my solution  ;D (a visio extension to export the diagram, it can also export to SharePoint)
There is no zoom limit, at least that you can be rest assured ;D

https://unmanagedvisio.com/products/svg-publish/

Recent "faster" demo for org-chart type diagram (without svg filters):
https://nbelyh.github.io/svgpublishdemo/demo/PokemonBldgPlan2.html

sax symbol

Nikolay, are you saying that you've encountered these issues before? ;)

Obviously I'm talking about the same project mentioned in this thread: http://visguy.com/vgforum/index.php?topic=9470.0

I haven't received approval to use your solution on our network yet so I haven't looked at all of the capabilities. I will look at it in Visio off of the network and it should give me a good idea of how it will perform on our network. Between this thread and the last one I think there's enough information to proceed. I will use all of it to gain approval for use on our network.

Thanks again for all of your help, Nikolay!  ;D

Nikolay

#3
Some known issues you may encounter with SharePoint Online with my extension:

1. Permission to execute custom scripts is required for SharePoint site. By default, it's not enabled in SharePoint Online. It's a per-site setting.
https://docs.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script

2. You should have either "Full Control" or "Design" ("add and customize pages") permissions on the SharePoint site where you upload the publication. This is not the default either. Default "Contribute" is not enough.
https://docs.microsoft.com/en-us/sharepoint/sites/user-permissions-and-permission-levels

sax symbol

Nikolay,

Thank you for the additional info. I did an offline optest of the popovers and zoom, everything performed well! I could zoom in and see the detail that I wanted. Everything was formatted the way I wanted it to look. I did have one other question: in the popover custom template where you enter the markdown code, can those values be dynamic or is a "snapshot" taken of the data at the time of publishing? For example, if the data in a linked field changes will you have to republish the diagram to reflect the data changes in the popover?

Nikolay

#5
Live connection to data sources you connected your diagram to in Visio is not supported out of the box. (Visio Online does support this, for sharepoint lists at least)
Out of the box, if data is coming from a SharePoint list, you will need to re-publish.

It is possible to have dynamic values, but you have to do it yourself.
For example, to have these values dynamically you can do it with javascript:

Like, in the template you can put something like a placeholder to receive the value (I've set id to "placeholder1")

...  something ...

<div id="placeholder1" />

... 


And add use some javascript code (in the "script" tab), like this (if the data comes from some API):

fetch('http://some.site.com/movies.json')
  .then(response => response.json())
  .then(data => document.getElementById("placeholder1").innerText = data);


Here is an example of such approach (temperature data used for coloring and tooltip data is coming from a free online weather service):
https://nbelyh.github.io/svgpublishdemo/demo/EuropeWeather2.html

You can also use the same technique to get values from SharePoint lists (using REST API), but you'll need to write some code like this.
You can use SharePoint ID for example to get the item (it is available from extension). I think I will make an example of such a setup, but not sure when.

Note that you can also run the code in response to the user clicking some shape or some control (like, you can add a button or edit box to the template), or on selection/view change.
The code has full access to shapes; the extension provides shape data to javascript code using API.
Information such as shape text, shape properties, connected shapes, layers, etc is available to the javasript code.
There is autocomplete (start typing diagram. )

sax symbol

Wow! I didn't realize it had become that complex.  I linked a record in a Sharepoint list with a unique desk number to a rectangle next to the appropriate desk in a Visio diagram in the Visio web app, and inserted a field onto that rectangle that reflected the last name of the employee, then whatever was in the record at the last name position was displayed in the rectangle. The default value was "vacant". This is what allowed me to reassign the desks at will. The problem was that if I had two or more employees with the same last name how someone looking at the diagram tell which employee was which? I thought of parsing the first letter of the first name and adding it to the last name, but it was only necessary when two employees had the same last name so I looked for a simpler solution. Your application would work perfectly because you could hover or click on the desk of the employee and determine which one was which, plus additional information if desired. If the employee wanted a seat closer to the door or a window seat it would be just a matter of reassigning them to a desk number and that employee's information would move with them. I would be disappointed if this capability had been removed in the Office 365 versions of Visio and Sharepoint.  :-\  If this is the case then thank you for a workaround because I know some choice words would be uttered when things stopped working after the O365 upgrade. :P

Nikolay

#7
In Visio Online, this connection works, in Office 365 as well. I was talking about my extension.
The Visio "stock" live data connections are not supported in my extension, so I was talking about workarounds.

If you use Visio Online directly to view the diagram (using "File Viewer" web part for example) the data update should work.
I mean, the data in the default viewer WILL change if you change the list item, and you won't need to republish the diagram.

sax symbol

Ok, that is good to know. So just to be clear, I make my diagram with linked data and publish with your solution, if I view the diagram using the File Viewer webpart in Sharepoint and make changes that a GUI may provide in the data, I should get all of the functionality that I have described. Does that sound correct?

Nikolay

#9
No, my solution is mutually exclusive with the File Viewer. You either use my solution, or use the SharePoint's built-in file viewer (that has visio-data-refresh implemented by the SharePoint).  They are NOT complementary.

But updating data from SharePoint online automatically could be probably a good feature for me to implement in the future :D

sax symbol

Ok, thanks for the clarification. I'll continue to look at these and other options and decide what might work best for us. When I get this thing done I hope that they recognize what kind of effort was put into the resulting application  ;) Thank you for your assistance, Nikolay! I'll be looking to see what else you might develop for Visio and other apps in the future!  8)

sax symbol

Hello again, we finally got 365 installed in our office and as I start to explore in the "new" Sharepoint the areas discussed previously are now pretty self-evident. It is definitely easier to navigate and publish as compared to previous versions of Sharepoint.

Now that I have gotten my floorplan uploaded, published to Sharepoint, and can zoom into 400%, as Nikolay stated above, I find that the floorplan is distorted/blurry as compared to the same diagram viewed in the Visio desktop app at 400%. I've tried .vdw and .vsdx versions of the floorplan and they look the same. The 400% zoom would be acceptable if the diagram was readable. Any ideas?

sax symbol

After doing everything I could think of I simply changed the scale of the drawing. I have to resize all of the fonts in the diagram but the issue has been resolved. Thanks to all who made their suggestions!