How to learn Matplotlib without searching Google -- - javascript

I am not really new to Matplotlib. I have made quite some figures with it, though I don't use it everyday (or every week, or even every month). So I tend to forget some basic things, for example, how to add a legend, how to add a color bar, how to customize a colormap, how to change the font of a specific part of the figure, how to make some transparency effect, etc. Of course, each time when I have a question, I can always google it and Google will most likely take me to stackoverflow or some other similar sites, or some blog articles, and I can almost always get a solution. This gives me an impression that the ``official'' documentation is not as useful as it should be.
But I must be wrong, namely, the official documentation must be very useful, otherwise how do those people who answer the questions know the solutions? Maybe they are ``insiders'' (developers of Matplotlib)?
So my question is, in case you are not a developer (but you are welcome to answer this question if you are), and suppose you have answered many Matplotlib-related questions here, how do you learn those techniques by yourself without asking Google? Where and how do you look for if the answer does not come to your mind immediately (not Google, because it is you who is answering that question, and before that maybe the answer does not exist in Google yet)?
Note that I am not complaining about the documentation. I think I just haven't found an efficient way to make use of it.
Or maybe finding the solution to a specific request is inevitably not straightforward due to the intrinsic complexity of Matplotlib? By intrinsic complexity, I mean in Matplotlib similar things can usually be done in many different ways, thus if one happens to choose one specific (and uncommon for whatever reasons) way in the beginning, and later comes across a problem, the solution to this problem may not have been listed explicitly in the manual, and maybe only those gurus who know how Matplotlib really works under the hood can come up with a solution.

I'm quite confused why it's under javascipt ... and think it's not so good to ask on SO, Quora instead.
BTW, learn by doing works for me many times.
(I really hope I have enough reputation to add a comment instead of answer it since it has not an explicit answer)

Related

battle tested jquery / javascript drop down menus

Drop Down menus are a common and almost ubiquitous UI element, and yet, I find it really hard to "pick one". before heading down the long road of rolling and "battle testing" my own, I'd like to put it out there and find out what others are using.
What are the most popular solutions for jquery, or javascript dropdown menus ?
Should be, lightweight, easy to customise and properly cross browser compatible, and at least function appropriately down to IE8.
Ones I've tried and used in the past with the best experience that meet this criteria inlcude :
Super fish - http://users.tpg.com.au/j_birch/plugins/superfish/
Dynamic Drive Smooth Menu http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm
To Clarify: looking specifically for multilevel drop down menus similar to the examples above. I'm also open to "avoid these they're sh*t" type answers if you feel so inclined.
PS: please avoid adding 5 from one of the 500 drop down menu articles that appear when first searching on google, I'd like to know about what YOU"RE using, what dropdown menus YOU love and hate.
have you tried this may be this can give you what you want
http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
I personally have used SuperFish, in it's standard form, it's not too pretty but with quite a bit of adjustments I find it can look quite nice.
Then using something like this: http://snook.ca/archives/javascript/jquery-bg-image-animations
Demo: http://snook.ca/technical/jquery-bg/
Can make them look very cool!
After a fair amount of research and messing about, quite honestly I'm fairly disappointed with the options in this area there are a couple options but as commented above rolling my own seems to be the best way forward.

Javascript 3d-like carousel for complex content

I have been spending about 7 hours today, trying to:
a) Create my own carousel using intensive javascript and CSS3 features (see this pastebin)
b) Setup and integrate the Roundabout plugin from FredHQ
c) Setup and integrate the Cloud Carousel plugin from Professor Cloud
Both third party solutions were tried because i failed in accomplishing what i wanted by myself. Unfortunately, both solutions do not work the way i would require them to. Both are amazing for displaying images, but i need to show more complex content, a heavily styled DIV with multiple encapsulated DIVs inside, PNGs with transparency, and so forth.
FredHQ's version did not work as it did not scale the content inside my DIVs. Not even the text was scaled, until i removed the font-size parameter, but that is something i need for a proper layout. Cloud's version works with images only.
I have hit a wall and i cannot seem to find any other solution. It seems the word "carousel" is used for slideshows and sliders, so i find hundreds of such solutions, but not one that works like i need it to.
What i need is decreasing opacity on further objects, while the center one is at full opacity. Also further objects should be scaled down by certain scale factors. It does not have to be 3D (not desired, even), but due to the scaling it would look 3d-like.
It does not have to be jQuery, although its probably a good idea if it is.
Does anybody know or can anyone point me to a proper solution?
Have you looked at monete(git), http://www.jacklmoore.com/monte? 184 line. Not sure you'll find something easier to dig into and make it work your way. Hundreds of solutions? So I'll take it you looked at the cycle plugin as well. That's probably one of the most mature and robust ones out there. You're asking for a lot in your question and these kind of question just wear people out after a while. That's all.
You probably won't find anything that fits your needs EXACTLY and you'll have to roll it yourself or hire someone. If you get something going and come back for specific help, you'll fair much better.

Can someone clarify Raphael's documentation? (or know a place in which someone already has done it)

I´m working with Raphael, and I think that I´m using it in a way that does not take advantage of some features that seems to be useful.
For example, I´m trying to add a listener on a Set (a group of elements), in a way that on mouse over on any of those elements, the script triggers an animation on the whole set.
When you add a listener to a set, Raphael adds the listener to each of the elements and animates them separately.
Like you see in this example http://jsfiddle.net/4VYHe/3/ in wich I want that all the rectangles in the same set (set = horizontal groups of 10 rectangles), change the color attribute on mouse over on any of them.
I have found a few methods in the raphael documentation that i think must help to achive this. But I´m having a hard time understanding how these methods work.
For example:
the eve object(http://raphaeljs.com/reference.html#eve)
the Element.animateWith() method (http://raphaeljs.com/reference.html#Element.animateWith)
the Raphael.animation() method (http://raphaeljs.com/reference.html#Raphael.animation)
The Raphael Library seems to be really powerful and I really want to get it work properly, I don´t want to write all kinds of diferent javascript hacks, because I think that these tools have to get the work done in a more elegant way.
If you think that I´m using the wrong library I´m still open to all kinds of advices.
Thank you in advance.
---EDIT---
This is a working example (http://jsfiddle.net/4VYHe/6/). But this is a hack with lack of efficiency and elegancy. I want something that uses the correct tools on the correct way.
There is some information on this page. http://www.irunmywebsite.com/raphael/additionalhelp.php?v=2#PAGETOP . A couple of examples, but nothing that explain how things work in Raphael.
Take a look at this fiddle, I think it is doing what you are looking for. The fundamental difference is that you want to call animate on the set, rather than this. It appears that when you add a handler to a set, this refers to the individual elements in the set (which are iterated over to assign the handler), and not the set itself.
Note that I pulled the handler functions out into the getHoverHandler function:
function getHoverHandler(fillColor) {
var cSet = set;
return function(){
cSet.animate({fill: fillColor}, 300);
};
}
set.hover(getHoverHandler('#000'),
getHoverHandler('#FFF'));
in order to break the closure. If you try to do it like this:
set.hover(function(){
set.animate({fill: '#000'}, 300)
}, function(){
set.animate({fill: '#FFF'}, 300)
});
as you loop through, set will keep changing, and the closures will maintain awareness of this. As a result, all handlers will be acting on the last row of boxes.
If you don't understand javascript closures, you might want to look at this article. It is old, but in pretty simple language, and it helped me as I have tried to get my head around them.
Kreek is absolutely correct in this comment above. Sets are a workaround for the inconsistencies between SVG and VML.
In your example above, you're running into the same issue that you were facing in your previous question. Using this in an anonymous function will almost always not work in the way you expect, as this won't be referring to what you think it is. Have a look at this discussion, particularly the first two comments in the comments section. (As an aside, the commenter uses "self" as the reference to "this", which is much better than my "that", which goes to show there's always someone doing it better than yourself)
Anyway, with that in mind, I've cloned your fiddle, wrapped your set in an object, and put the events into the object constructor. By doing this, the event can then refer to that.set and animate all objects in the set at the same time.
It's a small but fundamental concept that will aid you throughout any Raphael (or javascript) development you do.
This doesn't answer your question directly, but hopefully clarifies some of the issues you seem to be discovering. I can't really comment on the animation calls you've mentioned, but I do think that Raphael as a library is definitely worth persevering with.
N.

Alternative to SIMILE Timeline for timeline visualization? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
So I have been having lots of fun playing with SIMILE Timeline, but unfortunately, it appears to be all but abandoned (most recently closed ticket May 2009) and riddled with memory leaks, especially when you are dynamically loading and unloading events (which is especially true in my case).
I am a novice in JavaScript, so debugging these leaks is going to be more than a little complicated. Before I dive head-first into fixing a problem in a language I don't understand or a codebase I have never looked at, I want to know if there is anything out there that compares to the feature-set that I can get with Timeline:
Multiple events on one band
instead of having 10, 100, 1000 rows of data, use the space available to fit multiple events on one line when possible
Scrollable
CSS styling down to the specific event
I can specify a specific icon, font, etc., for each event if I need to. This is great for highlighting error events or interesting events
filtering/searching/highlighting
highlighting a band of time or point in time
This would be a vertical band that shows a 'now' moment, or a band that covers a time period's start and end time
I know that alot of these features can probably be put into things such as Flot or HighCharts, but these things were next to free for me to use in Timeline, so I'm weighing the cost/benefit of whether it is easier to fix a memory leak or roll out 3 - 4 features on some library that doesn't have it. My gut says "fix the leak, it's easier", but I would like to know if anyone can show me something that might be 90% of the way there with a low barrier of entry to getting that other 10%.
Maybe you can use the Timeline from the (open source) CHAP Links Library, developed by Almende.
http://almende.github.com/chap-links-library/timeline.html
Have a look at the examples to see what you can do with the Timeline. It is quite flexible, you can choose your create your own layout and use your own CSS/HTML in each individual event.
Check out Timeglider (see http://timeglider.com/jquery/) which is an open source (MIT), JavaScript (uses jQuery) scrolling timeline under active development. It meets your first 4 requirements I believe but I am unclear about the specifics of your 5th requirement. I have only done some simple experiments with Timeglider and don't know it very well but maybe this is a potential solution for you.
We needed the Simile Timeline at Lab 21k so we took the source code, cleaned it up and published it using bower. So you don't need an alternative anymore.
https://github.com/Lab21k/standalone-timeline/
The Timeline project is very much alive, they just don't use Google Code anymore. The Simile widgets are now hosted on a dedicated homepage, here is the homepage and documentation of Timeline. Keep in mind that the links on the page are not consistent, many pages still link to the outdated wikis on Google Code and the mit.edu wiki pages. Keep that in mind when checking the wiki.
There is also an active mailing list on Google Groups.
This is probably the best one around right now:
http://timeline.verite.co/
I'm actually working with the Simile Timeline in a project of my called Event Viewpoint. I've fixed quite a lot of bugs and enhanced it with many contributions that I have found online including images for the event, a zoom bar, and some additional events.
It is a brilliant piece of work just needs someone to take the time to update it and make it more current. That is currently out of scope for my project, but if I have time in the next year or so I will start to enhance it.
It would really be great if people could revive the project, add touch events and so on.
If someone needs the source I am willing to provide it.
They’re still very active. David Karger makes frequent updates. Now they have the version 3.0.
You can find reference documentation here:
http://simile-widgets.org/wiki/Reference_Documentation_for_Exhibit.
The code is here: https://github.com/simile-widgets/exhibit
I don't know exactly what you want, but i'm working on this jquery plugin that it's being used in a website with dynamically managed events.

Rotating images + content - jQuery or MooTools?

I've found a feature on two different websites that I'd like to include on one of my web projects, but I can't figure out how they're doing it. I think they're using either jQuery or mootools, but I'm not sure.
http://www.x-plane.com/index_desktop.html
I'm new here so I don't have the reputation to post the other link, but if you do a Google search for "Andrews Institute of Orthopaedics" its the top result. I'll see if I can answer a few questions to earn my keep.
The thing that I like about these is that the images and text (including links) are all rotated together. I've done a few web searches related to cycle, rotate and slide but it's not coming together for me. Can anyone give me a nudge in the right direction?
The page you linked is using prototype for this (usually because that's what the author knew, as with most libraries), and it is custom script they've written. However, jQuery has a lot of plugins with various styles, just see what one fits your taste best. I'd suggest taking a look here and a look here.
Anything you find can be automated on a timer like the site you linked, or use buttons, or both. These are all pretty flexible, I'd start by finding the plugin you want, try and get it going, then asking a question here if you have problems getting it to behave exactly how you want.

Categories