How to emulate d3.js homepage? - javascript

On d3.js homepage, http://d3js.org/, any source code or examples on how the interactive hexagons are created? In particular, I have a set of photos and I'd like to create the same effect. i.e. on mouse hover, the tiles move a little and the hovered tile is highlighted.

If you look at the html source code, they use d3.js (of course) and d3hexbin.js, which is a library able to create and animate hexagons.
You can take a look on the code used in this page (thanks to dev tools) to learn how they use it.

Related

HTML5 Timeline, gantt control

I have a requirement to create a custom HTML5 based control which a cross between a timeline and a gantt chart:
However I cannot get a hold of a 3rd party control already on the market that would cut down some dev time.
It needs to have the miniature zoomed out timeline at the top for fast navigation which when scrolled updates the main section.
Is there anything that already exists, be that open source or paid, that can handle this scenario?
Yes, there is. RadiantQ FlexyGantt does exactly what you want. Here is a screenshot:
You can see online demos of our gantt here. When the page loads, select FlexyGantt on the left which is what you need and has a number of "timline" samples.
Ideal for visualizing resource utilization in a timeline, also very interactive and comes with a lot of useful features.
It looks like something I'd start from scratch - but that's just my way, I'm a Sheridan/Infragistics casualty from the early 2000s :-)
You could try to use two gantt controls as they are both just gantts. If there's nothing good for the zoomed out timeline, draw that using canvas, it's just rectangles and a draggable on top.

How can I create an hyperlink over an image with an irregular shape?

I have the world map on a web page. Suppose the user clicks on a country. I would like to attach a specific event to the user click based on the country clicked (example: it opens the wikipedia page of the country).
How can I proceed to detect the country and/or use an irregular shape rather than the area of a circle or rectangle.
Try the below links,
Irregular anchors and shapes using JS in HTML/HTML5
Creating irregular shaped HTML links with image maps?
Can I use CSS hover on this complex irregular shaped link
Please do search the site before posting a question. You might find some relevant answers already present in the site.
I suggest you to use a javascript library like D3.js
Sample 1
Sample 2
The syntax use chaining method and is really easy to ready what a line of code does:
d3.selectAll(".country").style("stroke-width", 1.5 / s);
There are a lot of tutorial, and you want to make the country clickable and attach an event right ? well this library is awesome for that.
Starting guide

Circular segmented slider control in javascript

Is there any JavaScript (even better if it's based on jQuery) slider that is circular in shape and that also allogs to draw segments on the circle. Here's a drawing of a sample of what I'd like to achieve:
As you can see, the yellow slices are those that have been selected, while all the rest is just a background image (this is done on an iOS device with a custom control).
It would be nice to find something similar for HTML pages if there's any around.
Thanks!
This might be useful. It's very good.
jquery-knob
I ended up using a custom solution based on oCanvas.

Google maps - apply grayscale custom styling to terrain view

I made something like this:
http://static.cmslog.com/testapp/google/terrain
What I want to achieve now is terrain map with grayscale styling like here:
http://static.cmslog.com/testapp/google/maps
For now I applied the same rules (saturation: -100 for all), but it doesn't work. I can't also achieve this effect here:
http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html
Does anyone know, how to make terrain map in grayscale so it looks like this image:
I didn't provide any code, as all I have is under links pasted above.
Also this method doesn't work :/
Sorry if links above will stop working after a while.
It does appear that Google do not allow [do not have the capability for] the terrain map tiles to show the land as styled. You can style everything but the land itself.
So: can't be done. The Terms of Service only allow you to do what the API is capable of, and it can't style the land in terrain maps.
According to what #Andrew Leach wrote, the only way to do it, is to convert terrain map images to grayscale (i.e. in PHP) and cache them in your own server. Then you can replace them in HTML, as I made it here:
http://static.cmslog.com/testapp/google/terrain-tweak
EDIT:
But as it's stated in comment below it's against ToS, so it can't be done in this way, and link is down now.

Timeline Charts like Github.com

Has anyone seen an open-source library that produces charts similar to Github.com's commit timeline charts? Check out this profile (picked one at random) and note the bar graphs below each project.
I've been trying to dominate Flot into behaving correctly but it just doesn't have the flexibility of formatting options to come up with a decent clone. Personally, I'd prefer a Javascript implementation but I'm open to looking at server-side stuff as well.
Definitely has to be a stand-alone implementation, the application is headed to a network separated from the Internet, so Google Charts API is out of the question.
I'd suggest using jQuery Sparklines. You'll need to create two separate graphs and position them on top of one another (one for the blue bars, another for the gray bars). You'll also need to make the dotted line/legend an image, but github also uses an image for that.
Here are some decent values to get you started:
EDIT: I originally overlapped two separate sparklines with relative positioning, but it would be better to use the "composite" option to draw two graphs on the same canvas.

Categories

Resources