Cytoscape.js extension for more flexible coloring of edges - cytoscape.js

I'm using cytoscape.js to draw a graph. I'd like to do some fancier coloring of my edges similar to this:
I can't find any existing extensions for this, and the docs are pretty unclear on how I might write one to do something like this. I could probably hack this particular dashed style with two edges and some dash config-ing, but...thats hacky. Is there a way to do this correctly, or am I SOL?

Visual style features need visual style properties and renderer support. Extensions are usually for layouts or interactive widgets (e.g. tooltips).
If you want particular style properties, you should define them in a feature request in the issue tracker. PRs are always welcome, but it’s good to define the feature well first so we can discuss and iterate on the API design beforehand.
There’s a lot going on in the picture, but maybe you mean something along the lines of a line-dash-background-color property? It’s also not clear to me what the usecase is for having the alternating colours. In any case, start by defining the property or properties in a Github issue and we’ll go from there.

Related

MapKit how to get the Bezier path of a State

When i look at apple's Map, I can see the different bezier path of a specific place. I would like to know how to extact that information directly from the map. So let's say the user selects New York, I would like to highlight NEW York's Bezier path directly on the map. can this be done?
You will need an alternative form of data that ideally is very close to or exactly the same as the border being drawn by MapKit. You aren't going to get this from Apple.
Take a look at this blog post, where I accomplish the same thing with an open source framework (Mapbox GL) on the web:
http://justinmiller.io/posts/2015/01/20/anatomy-of-a-travel-map/
The ability to highlight areas like this should work in the iOS version of the toolkit as well (https://github.com/mapbox/mapbox-gl-cocoa) though you will not be able to do the interactivity directly in that framework.

Draw connections/paths between elements in XAML

I am currently developing an app where you can move different elements (boxes) and I need to display several arrows between them to show off connections and data flows. I don't want to use simple lines because this looks crappy. I recently used this great JavaScript library which does the thing I need for HTML: http://jsplumbtoolkit.com/jquery/demo.html
Is there something similar for XAML out there?
Thanks in advance!
I think, you should use bezie curves. From MSDN
To create a quadratic Bezier curve, use the PathGeometry, PathFigure, and QuadraticBezierSegment classes.
Simple example for creating bezie curves

How can I allow the user to style font in NSTextView using interface buttons in xcode?

In short:
I am trying to find information about text styling inside an NSTextView. Bold, italics, indentation, making a word completely uppercase and setting backdrop colors to certain lines.
Any and all info is welcome. I've been looking around the web for docs on the subject and only managed to find a few things that seem to be part of an iphone framework. I'm sure there must be something out there and that I'm just searching for the wrong words.
A few details:
I am not a developer. I am a motion graphics artist and screenwriter. I do know html, php, javascript, css and several scripting languages (all very similar to javascript) used by different graphics apps.
I am not very proficient in objective-c but I've taken up writing a screenwriting app as a bit of a side project. I've been teaching myself objective-c from a book call Cocoa Programming for Mac OSX and using the code I've created from the examples in the book to create my app using Xcode. Styling text was not covered and I am at a loss as to how to approach it.
Screenplays have very specific formats. Using css I could create this format easily so my first thought was to find out if text inside a NSTextview can have css applied to it. I've not found anything that could answer this. Of course I am probably way off with this approach.
Again, any help or anyone who can point me in the right direction would be extremely appreciated.
Thanks!
-Omar
You can't do this because it only accept one style.
You have to deal with UIWebView Tutorial for this and use your CSS.
Or you can use some code like EGOTextView. I do not test this but I think it will be the easiest way for you.

iOS/Objective-C Design Pattern for UI Themes

I need to write a iOS Objective-C app that supports Themes. The idea is that through some configuration control panel, the user is able to select one of the three hypothetical themes {redTheme, greenTheme or blackTheme} that are predefined in my app, according to the following schema:
1theme http://www.timotteo.com.ar/ThemeChart.png
The user could also even choose the new theme while he is seing the view, and the view would automatically redraw (although this is not a fundamental feature). I would also expect to have a basic theme, (for example whiteTheme). The themes would customize not only the background colors of the view, but they would also customize the images of the UIButtons, UISliders, etc.
My question is: is there a design pattern that would help me solve this problem? Or at least some OOP concept? Any direction is appreciated. Txs in advance
Well from the nice diagram you prepared it looks a lot like Strategy Pattern (or any number of similar patterns). See more at: http://en.wikipedia.org/wiki/Strategy_pattern
Kind regards,
Bo
Basically, you can consider the approach WinterBoard uses for theming. Make your UI element image names unified (for example, buttonBackground.png, statusBar.png, etc.) and store the non-image (pure color) information in a PLIST file, with keys for each UI control, something like
<plist>
<dict>
<key>ButtonBackgroundColor</key>
<string>#00ff00</string>
<key>LabelBackgroundColor</key>
<string>#007fcc</string>
</dict>
</plist>
et cetera. Then, make your themes according to this pattern, use the same image names / color keys in your app for loading the UI data, but based on the current settings (which is presumably stored in NSUserDefaults), load the resource files from a different directory.
I hope this will be helpful.
UIAppearance framework makes this job easier for navigation bar and UIControl objects
https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIAppearance_Protocol/index.html

Very confused by a binding issue between a Cocoa app and a Movie Loader patch in Quartz Composer

I've been programming for a while, but just recently decided to start developing for Mac OS X. I feel like I've come to grips with the basics of Objective-C and Cocoa development over the past week. I'm planning on making graphics apps, and as such am currently in the process of learning how to control Quartz compositions through a Cocoa app. I went through the tutorial that apple offers (with the Mac Engravings composition), and was able to create that just fine. In order to make sure that I truly understood what I learned, I decided to create my own composition and link it to a slightly more complicated Cocoa application.
Essentially, I have a composition that loads a movie or image through a Movie Loader patch, at which point it applies various filters to the frames before outputting it. In my Cocoa app, I've written code (or rather copied and pasted from other apple examples) that lets a user pick a file using an NSOpenPanel object. The filepath of the file they pick gets placed in a text-box that I placed in the app's window using Interface Builder. I binded the value of said text-box to the "Movie_Location" key in my composition, which is a published input in the Movie Loader patch that I'm using. However, no matter what I do, movies and images aren't loaded into this composition no matter what I try. The only thing that gets displayed is the default image that I have saved in that input from Quartz Composer (or nothing if I leave it blank before publishing).
I've added a Clear Color patch to the composition and binded that to a colorwell in my UI, and that successfully changes the color in my display, so I know that the composition and my Cocoa app are communicating. I've spent numerous hours at this point trying to figure out what's going on, and I've just about given up. Does the Movie Loader have any weird behaviors that I'm not aware of, or is there something obvious that I seem to be missing? I'd really appreciate any help or advice from anybody.
Thanks for reading through this...
Best,
Sami
There are two things I can think of as reasons why it is doing this:
The file path isn't formatted incorrectly. Try checking backslashes, colons, etc.
The box isn't updating the value. Try literally clicking in the text field and hitting enter.
That's all I can think of without seeing your quartz composition and/or code.
EDIT:
Check the other continuous box, in the general properties.
I figured this out yesterday. spudwaffle's second idea is what was going on. If I were to type a filepath in and hit enter, it would work just fine. I got this to work properly by just removing the bind and instead using the setValue:keyInPath: function that a patch controller offers. That said, is there some way to force a text-box to update? I remember seeing a "continuously update" or something like that button within the bind sub-menu in the inspector, but my code didn't work with that checked either.
Thanks to those of you that tried to help me! I really appreciate it.
Best,
Sami