What parameter in Cytoscape determines the stacking order of edge rendering? - rendering

I have created a cytoscape network with a number of crossing and re-crossing edges. It is meant to do this, and I don't wish to reduce the amount of crossing that is occurring.
I would, however, like to be able to determine which edges are on "top" and which are in "back" - in the same way that you would "bring to front" or "send to back" in Powerpoint or Photoshop or any of numerous display programs.
Which style parameter or similar value is used to determine rendering order of edges? Note that I am referring to the edge line itself, and not some annotation.
Thanks much.

Unfortunately, that isn't available in the current release, but Cytoscape 3.9 will include that feature. If you want to try a copy of 3.9 (which isn't nearly ready for production release), you can download it at: https://cytoscape-builds.ucsd.edu/cytoscape-builds/Cytoscape-3.9.0/
-- scooter

Related

How do I fix garbled text in my react-pdf viewer?

I have created a pdf viewer using react-pdf. When I display certain pdfs, the text is choppy and unreadable. I have tried zooming in and out of the document and it is choppy in different ways at different scales. Sometimes the text even looks okay at a certain scale after zooming out and then zooming back in.
(Sample at 1.5 scale)
(Sample at 1.6 scale)
At first, I thought it might be an issue with react-pdf, but I saw that react-pdf is basically a wrapper around PDF.js. I found that I can replicate the issue in the PDF.js demo page.
Unfortunately, I'm working with a pdf that contains identifying information, so I can't share the full pdf or full screenshot. I'll include as much as I can figure out to share.
What I have tried
My initial thought was that maybe the component was rendering small initially and then had issues scaling up. So I made the initial size really large, but that didn't fix it.
I made sure that standard fonts were included following the instructions on the react-pdf home page
I tried using pdf repair tools online to maybe fix the pdf itself. That didn't help.
I tried changing the renderMode to 'svg' as detailed in the Document api documentation. This was the most helpful fix, as it does render the text correctly, but it then makes it so the images on the pdf don't load.
Thanks for your help/suggestions.
If I can find a way to edit the pdf to not have sensitive information, I'll try to find a place to make it available for testing. I apologize that I cannot provide that at this time. I know it's difficult to give advice when you can't replicate it yourself. I'll work on that.
From a programming point of view there is only "Providing a standardFontDataUrl and disabling the font face" (see later), however it affects many pdf.js based code developers outputs, thus I consider as still "OnTopic"
This issue is still open in react-pdf, though I have seen it mentioned by other pdf.js users since mid year (MS or Chrome update ?) , so unsure if it is not a wider fail affecting Mozilla PDF.js code users.
https://github.com/wojtekmaj/react-pdf/issues/1010
https://github.com/wojtekmaj/react-pdf/issues/1025
There semes to be earlier reports back in Early March and then later suggestions to change win 10 drivers. However also reported by win 11 Pro users. PDF.js versions from 2.8.335 to 2.14.305, and it doesn't affect version 2.7.570. so partially down to updated versions ! But seen only in Chromium.
It is entirely possible that we started doing something that trips Chrome,
The symptoms seem to be hardware or settings orientated since it is reportedly seen on some identical groups of users but not affecting others.
toggling back and forth between single page and multi-page views the issue resolves. It also seems dependent on the resolution or appears on some machines and not others so it is a little tricky to repro.
I am not getting it personally, but a guy in my team get it.
Unclear which browsers are affected but looks like its a chromium / web kit rendering bug ?
Several browsers have been tested and only chrome faces this.
My colleague gets the same in Edge Version 101.0.1210.47 (Official build) (64-bit) and Brave (1.38.118 Chromium 101.0.4951.67) Will edit the issue
The suggested workaround is :-
Providing a standardFontDataUrl and disabling the font face fixes the issue.
if we disable Accelerated 2D canvas in chrome://flags then the preview appears nice and okay. But since this flag is on by default so user see the pixelated preview. Unless we ask them to turn off this flag.
Figured out that this only happens when hardware acceleration is enabled in your Chrome settings.
When its turned off the issue does not happen.
In address bar paste chrome://gpu or edge://gpu etc (its a long report of current onboard fixes) in my case (currently unconfirmed via reboot for my Edge) is showing Accelerated 2D canvas is unavailable: either disabled via blocklist or the command line. Disabled Features: 2d_canvas, thus I cannot see problems.
To change setting you can use
chrome://flags/#disable-accelerated-2d-canvas
but its a manual choice between options.
so on reboot I see
Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
but have little problem with the domo (except normal fuzzy text as pixels) so either Edge update or my hardware is not visibly affected or my default settings are reasonable.
This issue has been finally fixed in the latest version of react-pdf library. Check here: https://github.com/wojtekmaj/react-pdf/releases/tag/v6.2.2
I also faced the same error and I fixed it by setting render mode to canvas (earlier it was SVG) and scale value to more than 1. Try scale = 1.5

Workable alternative to "Presentation Mode" in Intellij and Pycharm

As detailed in this YouTrack issue https://youtrack.jetbrains.com/issue/PY-40008 Presentation Mode is basically a one-way ticket: you can check in but you just can't leave.
One of the "misses" of returning to "normal" mode is that only the Editor panel is displayed: the Explorer, Debugger, etc. are all invisible.
That's a hassle to rectify in real time when presenting to a group of people. When I am actually giving presentations that include code snippet walk-throughs going back and forth between modes is mandatory so then Presentation Mode is a non-starter.
But then what? I code at a small font to view lots of code at one time. This is incompatible with displaying code on a projector. Here are some attempted band-aids:
Hit Command-+ a few times to increase the font. This does work, but if I switch to another file then I have to repeat that process: the new file does not "inherit" the zoomed-in preference. Then if I switch back to the first file it too has forgotten the zoom. That is very annoying for me and the audience
Change the Editor|Font .
This is a potentially better solution: at least it does affect all files and is "sticky". However I do find that the optimal resolution often requires tweaking for a given audience due to differing viewer characteristics e.g. Zoom vs Hangouts. So then I end up going into that dialog more than once with a gaggle of folks watching/waiting. Also not ideal.
The behavior is identical across recent releases of both Intellij (Ultimate 2019.3.1) and Pycharm (Ultimate 2019.2.3).
Anyone have alternative/better approaches?
I setup several Color Scheme Font schemes for desktop/laptop/presentation with different font sizes. I then use Ctrl-~ to quickly switch between them. Doesn't solve all the issues you mentioned, though.
I took a separate approach to fix this actually. When your font size is messed up after exiting the presentation mode, you can do the following.
Go to Preferences and then Appearance. Find the font size of the presentation mode and set it to the default font size (in my case it was 13). Then click Apply and you are good to go. Set the font size to 20 (or any other bigger size) back again for presentation mode.

How is it possible to increase the size of the workbench (Canvas) in the gnuradio-companino

I am working with Gnuradio-companion, working on a bigger project with a lot of blocks for the first time. The space on the workbench is getting scarce.
Do you know if it is possible to increase the size of the workbench?
Starting with GNU Radio 3.8, this is no longer necessary: the canvas auto-adjusts its size, and you can zoom around in it (usually, using ctrl+scroll wheel).
So, if this is a problem you're encountering, you're using the End-Of-Life GNU Radio 3.7 release series (or older). You should not be doing that. It's time to upgrade your GNU Radio.
To preserve the old answer:
Double-Click on the "Options" block and adjust the "Canvas Size" (it's width, height in pixels).
Another good approach to keep your flow graph manageable is to take groups of blocks and put them into "hier" blocks (select connected blocks, right click, more, Create hier); use "Pad Sinks" and "Pad Sources" to create in- and outputs for your new hier block, and use that hier block in place of the bunch of blocks, to keep your flow graph tidy!

Photoshop jsx image grid

What I am ultimately trying to do is to create a grid of images for print that are minor variations of the same thing (different text is all). Looking through online resources I was able to create a script that changes the text and exports all of the images necessary (several hundred). What I am trying to do now is to import all of these images into a new photoshop document and lay them all out in a grid and I can't seem to find any examples of this.
Can anyone point me in the right direction to place a file at a specific coordinate (I'm using CS5 and have the design suite so if there is a way in illustrator to do this quickly...)?
Also, I'm open to other ideas on how to do this (even other programs) easily. It's for labels so the positioning on the sheet has to be pretty precise...
The art layer object has a translate() method that takes delta x and y params. You'll need to open each image, copy it to the target document, get its current location (using artLayer.bounds) and do the math to find the deltas to position it where you want it. Your deltas can be in pixels so you'll get plenty of precision.
Check out your 'JavaScript Scripting Reference' pdf in your Adobe install directory for more details.
Ok I'm marking Anna's response as the answer because though I didn't fully test it, it seems like it should work and answers the original question with jsx. However I'm also leaving my final solution in case anyone else runs across this with the same issue and may prefer this method as well.
What I ended up doing instead is using InDesign. I figured out that it has a grid option that lets you import a number of files and place them all in an equal grid in a single command. This is almost exactly what I was looking for, except that it leaves a small border/margin in between the columns and grids and mine were designed to meet exactly.
I couldn't figure out how to make it not have the border (I have very little experience with InDesign, it may be possible). However I was able to select all my images and scale them uniformly to be the correct size, then I just selected each column and dragged it over to snap to the adjacent column and the same with rows...

Finding a word's frame (position and size) on the screen using Cocoa or Carbon

Here's a tough one:
I need to be able to find a word's position and size (its frame) on the screen (its first occurence is enough, from there I should be able to get the next ones).
For example, I would like to be able to detect word positions in (but not limited to) Word, Excel and PowerPoint for Mac, as well as Safari and others.
The solution should be as fast as possible; I should be able to find at least 5-6 words per second and use as little CPU time as possible.
Here's what I thought of so far:
OCR in a window's screenshot / graphics context (any good Open Source framework that works on Mac OS X 10.4 and that can be used in a commercial product?). Evernote is very good at spotting words in images. I don't know if it uses a custom in-house engine or an Open Source / commercial one but that would be the kind of engine I would like to use if this is a "valid" solution. Ideally I would detect the word's frame in the active application's window (how to get the frame of another application?).
Getting some kind of "hook" on Quartz drawing of text and intercepting the location of the word when it's drawn (does not seem very feasible at first glance!).
AppleScript, but it depends a lot on what API the application offers (I don't think you can get a word's coordinates in a Word document from what I've seen) and it's slow.
... out of ideas ...
My goal is to get all the word's frames in a paragraph in the right order based on a string containing the text of the paragraph.
Thanks in advance for any hints!
As a starting place, you may want to take a look at QuickCursor's code. It retrieves text from many different applications through the AX Accessibility APIs. Now, it won't grab the pixel placement of the word, but it will at least return the NSString associated with the text in that UI element. Of course this means that the app in question has to support these APIs; I don't know if the MS Office suite would. In addition, it only supports editable elements, so an un-editable webpage in Safari won't work either. But it may give you a starting point for some ideas.
Take a look at the QCUIElement.{m,h}, and then the implementation in the QCAppDelegate.m (beginQuickCursorEdit:)... the implementation of his abstracted QCUIElement seems to be as simple as:
QCUIElement *focusedElement = [QCUIElement focusedElement];
id value = focusedElement.value;
Edit: Aha! Check out the Accessibility Inspector Sample code: UIElementInspector. It can actually get the AXPosition of elements on a page. Now, it's not word-by-word, but we're getting closer. It'll tell you the x,y placement of a textblock, as well as the words contained in the textblock.
This is possible, but very hard to get working reliably. You can play with Spell Catcher's Direct Connect feature to see an example.