The tick format provided by d3.time.scale is a multi-scale tick format, meaning that it formats times differently depending on the time. For example, the start of February is formatted as "February", while February second is formatted as "Feb 2". The format is implemented using an array of time formats, each with an associated filter. The first filter that returns true is used. (In the implementation below, the formats are processed in reverse order.) You can create your own custom multi-scale time format using the same technique with only a few lines of code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Swimlane using d3.js</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<script type="text/javascript" src="randomData.js"></script> | |
<style> | |
.chart { | |
shape-rendering: crispEdges; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script> | |
// moment.js | |
// version : 1.6.0 | |
// author : Tim Wood |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'IcoMoon'; | |
src: url('http://benfrain.com/downloads/IcoMoon.eot'); | |
src: url('http://benfrain.com/downloads/IcoMoon.eot?#iefix') format('embedded-opentype'), | |
url('http://benfrain.com/downloads/IcoMoon.svg#IcoMoon') format('svg'), | |
url('http://benfrain.com/downloads/IcoMoon.woff') format('woff'), | |
url('http://benfrain.com/downloads/IcoMoon.ttf') format('truetype'); | |
font-weight: normal; | |
font-style: normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Quote demonstration | |
*/ | |
html { | |
min-height: 100%; | |
} | |
body { | |
background-image: linear-gradient(yellow, orange); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg.on("mousemove", function() { | |
var x = d3.event.pageX - offsetLeft; | |
var beginning = x, end = pathLength, target; | |
while (true) { | |
target = Math.floor((beginning + end) / 2); | |
pos = pathEl.getPointAtLength(target); | |
pos.x += margin.left; | |
pos.y += margin.top; | |
if ((target === end || target === beginning) && pos.x !== x) { | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module ng.grid { | |
interface GridOptions<T> { | |
columnDefs?: ColumnDef<T>[]; // Array of Column Definitions.. | |
groupHeaders?: boolean; // Whether to group the headers. Default is false. | |
headerHeight?: number; // Height, in pixels, of the header row. If not grouping headers, default is 25. If grouping headers, default is 50. | |
rowData?: T[]; // Data to be displayed as rows in the table | |
rowSelection?: string; // Type of row selection, set to either 'single' or 'multiple' to enable selection. | |
rowDeselection?: boolean; // Set to true or false (default is false). If true, then rows will be deselected if you hold down ctrl + click the row. | |
pinnedColumnCount?: number; // Number of columns to pin. Default is 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const print = (param, ...args) => { | |
console.log(param, ...args); | |
return param; | |
}; | |
const traceFn = (fn, context) => function () { | |
console.trace(`${fn.name} called with arguments: `, arguments); | |
return fn.apply(context || this, arguments); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************************* | |
Copyright (c) 2019, Greg Lockwood | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |
OlderNewer