cytoscape.js: canvas refresh after batchData? - refresh

After updating node attributes using the great batchData command (these attributes are mapped to node color, size and border) the displayed network does not change until I select the nodes with my mouse. Various attempts at forceRender reset and fit did not help. So for the moment I am improvising like this:
cw.batchData(noa);
cw.elements("node:visible").select().unselect()
Which works fine, at least on a small network.
Any other advice? Shall I send a minimal example, or a jsfiddle so this can be recreated?
Thanks!
Paul

I'll see if I can reproduce this on the demo page, since it seems straighforward, but please describe this issue in the tracker. https://github.com/cytoscape/cytoscape.js/issues/new
Edit: I can't reproduce this on the demo page (the mapped styled get updated after cy.batchData(), so an example would definitely be worthwhile).

Related

How to build an advanced link in draw.io

I am looking for how you can build a link in draw io, so that when you click first, it hides a layer and then opens a different page of the same draw io document.
so far i tried this:
data:action/json,{"actions":[{"toggle": {"cells": ["SvuciECQg7tZUCU10AH1-3"]}},{"open": "data:page/id,IZEQzf0yfGXm-2QJ5-Q8"}]}
But it seems that the Toggle is executed after the Open, and I need the Toggle to be first and then the Open.
I even tried to do an Open of the same page I'm on, do the Toggle, and then do the Open of page 2, but it didn't work. I would appreciate if anyone knows how to do this, thank you very much.
This is pretty old, you've probably figured it out or given up by now. In case you haven't:
If you want to Hide a layer, just Hide the layer. This did exactly what you're describing: (I've inserted your IDs)
data:action/json,{"actions":[{"hide":{"cells":["SvuciECQg7tZUCU10AH1-3"]}},{"open":"data:page/id,IZEQzf0yfGXm-2QJ5-Q8"}]}
If you need to toggle the layer back on, you'll need to Show it again. The code you have works, it's kindof unexpected not knowing if the layer is showing or hidden at the start.
Unless the layer you want to show/hide is on the different page.
You won't be able to interact with objects on a page that's not in scope. In that case, you probably want to hide the layer by default. That way, when you Open the second page, the layer is already hidden.

How to change WebBrowser fullscreen video mode?

I have a c++ project with 2 WeBBrowser in a TableLayoutPanel they are set side by side, it's working fine I navigate normal but when I go to specific websites and play a video in fullscreen that sets my whole monitor to fullscreen instead of setting only the WeBBrowser itself, however on other websites that fits perfect in the WeBBrowser. Is there a way to change the way it displays fullscreen? I wanna make it display fullscreen in the WeB​Browser only. I think it has something to do with Web​Browser​Base.​Active​XInstance Property or Web​Browser.​Document Property. Most examples I find on the internet is for the old VB and not related to the fullscreen property.
Here's a similar question:
WebBrowser control video element enter fullscreen
In other examples I've seen a method to extract the element by doing:
HtmlElement^ object = webBrowser1->Document->GetElementById("video");
But I have no idea how to handle that code in order to format that video then set it back to the WeBBrowser with fullscreen mode fixed.
EDIT:
I went further and I could get the <video> element just from a few websites, here's my method:
private: System::Void webBrowser1_DocumentCompleted(System::Object^ sender, System::Windows::Forms::WebBrowserDocumentCompletedEventArgs^ e) {
HtmlElementCollection^ videoElements = webBrowser1->Document->GetElementsByTagName("video");
videoElements[0]->SetAttribute("style", "width: 640px; height: 480px;"); //Not sure if this is a proper way to set an attribute in this element.
}
The problem is that not every website gives you access to <video> tag elements, so for those websites I did the following code to make sure there were indeed no <video> tag elements in the source:
System::Diagnostics::Debug::Write(webBrowser1->DocumentText);
Then I didn't find any <video> tag element in the output, only a few websites provide me that. Why? How to really get and manipulate properly <video> tag elements in c++?
Then I didn't find any tag element in the output, only a few websites provide me that. Why?
Let me make an educated guess. For some of the pages you're referring to, the DOM is built dynamically and asynchronously. Which means, those <video> tags might simply not be there yet.
So, you might need to have some asynchronous polling logic in place that monitors DOM changes, specifically looking for <video> tags.
It might not be possible to come up with a 100% working solution to cover all cases, but have a look at my other post which deals with this problem.

Listing multiple Redmine issues by Id

I am working on some custom Redmine reports. In the generated report, there are numbers that represent things like "number of issues moved to Development during Q3 2013". The report generator knows the issue id of every issue that matches that criteria.
Is there a way to construct a Redmine URL that shows a list of all issues given a list of issue ids? For example, something like (this doesn't actually work):
http://redmine/projects/example/issues?ids=1234,1239,1245
This is similar to existing feature requests such as http://www.redmine.org/issues/10828 but I'm looking for the user-facing HTML version, not an API function. The idea is to allow the user viewing the report to click on the number and to see the corresponding list of issues.
The solution I ended up with was to include the list of issues in a <div> for each number in the report that the user could click on. Then, when the user clicks on a number, the corresponding <div> is displayed using a jQuery UI dialog.
This is not the same as using the Redmine issue list screen to show the issues. However, for this purpose it works well enough.
No, this is not implemented. But for me it should never be necessary in the Gui.
My Solution would be : Build the adequate query. Eventually this will need the addition of a field in Redmine and backporting the information from your tool to Redmine. Generally the need for this feature shows your bug tracker lacks some information that he should track.

Ember.js having more than one view per controller/model

I have a controller and a model that get some data from the server.
I'm trying to initialize two views, one for editing and one for showing a list of items related to this data. For example, the model holds some search properties which the user may edit. After editing the search params I want to switch between the two views and display the refined search results.
I can't find any sample that does such switching.
I tried using Ember.ContainerView samples but all seems to be failing with nasty runtime errors.
Not sure that I have any relevant code sample :-(
Any help would be gladly appreciated
I've put together a demo that toggles editing, nothing special but it simulates your use case I guess, have a look here.
Hope it helps.

Unpredictable display of Facebook og:image

We added Facebook Open Graph tags to our site NowGamer.com a few months back and everything worked perfectly initially. But in the last few weeks we've noticed that on about 2/3 of images the og:image would not display when an item was shared or liked. Sometimes going to the linter would scrape the page and the image would then be available.
But in other instances the image thumnbnail doesn't appear in the linter - although the link to the full image displays it at full size OK.
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.nowgamer.com%2Fnews%2F1298151%2Fassassins_creed_3_join_or_die_freedom_collectors_editions_details.html
The images all fit within the 3:1 parameters although they are relatively large (they have to be as they are screenshots for video games). Here is an example of exactly the same type and size of image that does display in the Linter and on shares/Likes
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.nowgamer.com%2Fps3%2Fps3-reviews%2F1293635%2Fresident_evil_operation_raccoon_city_review.html
I can't see why one works and the other doesn't. Any suggestions?
The thumbnail's width AND height must be at least 50 pixels, and
cannot exceed 130x110 pixels.
http://developers.facebook.com/docs/share/
Strange: I would have gone with a cache problem which I've also experienced before. For pure testing purposes if you want to attempt to refresh a different version of the URL try adding ?v=1 or some other parameter which makes the URL unique. This forces Facebook to go and get the URL again so you can make sure the images are working as expected.I think YouTube have also had this problem over the last few months http://groups.google.com/a/googleproductforums.com/forum/#!category-topic/youtube/sharing-and-connecting-on-youtube/YnTqofAhcN8