Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) diagram not display when clientsidemode is Canvas (Read 13653 times)
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
diagram not display when clientsidemode is Canvas
Mar 12th, 2015 at 4:02pm
Print Post  
Hi there,

As title said, diagramming is working and displaying well while I set the clientsidemode to ImageMap or SvgImage.

Then if I set clientsidemode to Canvas, the area of my webpage where should be my diagram is empty. I only changed clientsidemode.

Then I tried to output this "invisible" diagram to pdf, it works and it exactly shows up in pdf file as it should be.

That means my data is correctly loaded, but the diagram under 'Canvas' mode is "invisible"...

Btw diagram Behavior is "DrawShapes".

Any hint?

Thanks a lot!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #1 - Mar 12th, 2015 at 6:51pm
Print Post  
Hi,

Have you added mindfusion.diagramming.js to your project? You must also add a ScriptManager to the page to load the Microsoft Ajax libraries required by the diagram scripts, or explicitly load MicrosoftAjax.js before the <DiagramView> element.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #2 - Mar 12th, 2015 at 6:59pm
Print Post  
Yes. I have mindfusion.diagramming.js in project folder and I have scriptManager  in the page.

Stoyo wrote on Mar 12th, 2015 at 6:51pm:
Hi,

Have you added mindfusion.diagramming.js to your project? You must also add a ScriptManager to the page to load the Microsoft Ajax libraries required by the diagram scripts, or explicitly load MicrosoftAjax.js before the <DiagramView> element.

I hope that helps,
Stoyan

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #3 - Mar 12th, 2015 at 7:05pm
Print Post  
What browser are you using? The Canvas element requires at least IE9. Also check if there aren't any errors shown in the JavaScript console.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #4 - Mar 12th, 2015 at 7:25pm
Print Post  
Tested on both IE11 and Chrome, and no error show up in console window...

Feel like its visible is false coz I even could out put it to a pdf.
But of course I have set diagram visible is true.

Stoyo wrote on Mar 12th, 2015 at 7:05pm:
What browser are you using? The Canvas element requires at least IE9. Also check if there aren't any errors shown in the JavaScript console.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #5 - Mar 12th, 2015 at 7:31pm
Print Post  
What if you set the CanvasVirtualScroll property to true?
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #6 - Mar 12th, 2015 at 7:54pm
Print Post  
Not working as well.

I saw in chrome console->sources->Scripts->targetpage->diagram area code as below:
Code (Javascript)
Select All
<canvas id='_rep__diagViewer' width='0' height='0' data-json='{"id":"_rep$_diagViewer","width":{"IsEmpty":true,"Type":1,"Value":0},"height":{"IsEmpty":true,"Type":1,"Value":0}
 



Do you think because the 'IsEmpty' us true? But as I had assigned data to the diagram and it could output right pdf, why this?

Thank you

Stoyo wrote on Mar 12th, 2015 at 7:31pm:
What if you set the CanvasVirtualScroll property to true?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #7 - Mar 12th, 2015 at 8:16pm
Print Post  
What's your Diagram.Bounds value?
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #8 - Mar 12th, 2015 at 8:26pm
Print Post  
Code (Javascript)
Select All
"diagramBounds":{"x":0,"y":0,"width":406.399963,"height":238.65416} 



Stoyo wrote on Mar 12th, 2015 at 8:16pm:
What's your Diagram.Bounds value?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #9 - Mar 13th, 2015 at 9:08am
Print Post  
I was able to reproduce width=0 and height=0 canvas attributes by explicitly setting <ndiag:DiagramView Width="0" Height="0" ... />. This also set the size of div used for scrolling, so even if the canvas is resized from JavaScript to match Diagram.Bounds value, you still won't see it because the zero-size div. If you aren't explicitly setting zeroes for Width and Height, maybe that's done by the DiagramView' container control. What's the parent element of DiagramView in your aspx?
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #10 - Mar 16th, 2015 at 2:58pm
Print Post  
Yea seems we are on the right direction.

I put the mindfusion diagram in a aspx control then put this control in a page <div>.

Then I started to test via chrome developer tool.
As we could collapse and extend every html layer of current page.

If under ImageMap or SvgImage mode, in developer tool -> Element, when I point to right layer where my diagram should be, it is there, under a html form with an id. In fact this form has two sections, one contains some controls like button, one section contains my diagram.

Then if I only changed diagram clientsidemode to canvas, check via developer tool -> Elements -> same html form -> then only first section, the section with controls are still there, second section which should contains my diagram does not show up!

Interesting...well, tried check relative html layout, looks all okay, still could not figure out why the section been invisible or been modified to size 0 while on Canvas.

Thanks

Stoyo wrote on Mar 13th, 2015 at 9:08am:
I was able to reproduce width=0 and height=0 canvas attributes by explicitly setting <ndiag:DiagramView Width="0" Height="0" ... />. This also set the size of div used for scrolling, so even if the canvas is resized from JavaScript to match Diagram.Bounds value, you still won't see it because the zero-size div. If you aren't explicitly setting zeroes for Width and Height, maybe that's done by the DiagramView' container control. What's the parent element of DiagramView in your aspx?

  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #11 - Mar 16th, 2015 at 8:33pm
Print Post  
Another issue I found is once I switch from ImageMap to SvgImage, and keep other all the same, my "OnNodeClicked" and "OnCellClicked" functions are disabled.

Under ImageMap mode node click or cell click action will invoke corresponding function but once to SvgImage mode, node is "only" node, cell is "only" cell, no longer clickable. Do I miss something to switch between multiple clientsidemode?

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #12 - Mar 17th, 2015 at 8:26am
Print Post  
SvgImage mode is not officially supported and at this time we don't have plans to develop it further. It's just something we implemented for a customer to spare them going through SvgExporter:
http://mindfusion.eu/Forum/YaBB.pl?num=1333388860

Please attach a test project that reproduces the disappearing canvas problem.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #13 - Mar 17th, 2015 at 2:10pm
Print Post  
Thank you Stoyo.

So my understanding is mindfusion diagram svg mode does not support node click or cell click?

Stoyo wrote on Mar 17th, 2015 at 8:26am:
SvgImage mode is not officially supported and at this time we don't have plans to develop it further. It's just something we implemented for a customer to spare them going through SvgExporter:
http://mindfusion.eu/Forum/YaBB.pl?num=1333388860

Please attach a test project that reproduces the disappearing canvas problem.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #14 - Mar 17th, 2015 at 3:02pm
Print Post  
That's right, it only generates a static SVG image and does not support click events.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint