Skip to content

Commit

Permalink
grids wip
Browse files Browse the repository at this point in the history
  • Loading branch information
neocarto committed Oct 14, 2024
1 parent 43f5248 commit da04dc5
Show file tree
Hide file tree
Showing 21 changed files with 289 additions and 86 deletions.
5 changes: 3 additions & 2 deletions docs/global.html

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions docs/grid_arbitrary.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* @property {number} [width = 1000] - width of the grid
* @property {number} [height = 500] - height of the grid
* @example
* geoviz.grid.arbitrary(50, 1000, 500)
* geoviz.grid.arbitrary({step: 30})
*/

export function arbitrary(step = 50, width = 1000, height = 500) {
export function arbitrary({ step = 50, width = 1000, height = 500 } = {}) {
let grid = [];
let nb = Math.round((width / step) * (height / step));
for (let i = 0; i < nb; i++) {
Expand All @@ -40,6 +40,11 @@
},
};
});
return { type: "FeatureCollection", features: result };
return {
type: "FeatureCollection",
type: "arbitrary",
coords: "svg",
features: result,
};
}
</code></pre></article></section><footer class="footer" id="PeOAagUepe"><div class="wrapper">Nicolas Lambert 2024 - MIT License</div></footer></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">Home</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://github.com/riatelab/geoviz" target="_blank">Github</a></div><div class="navbar-item"><a id="" href="https://github.com/riatelab/geoviz/issuesz" target="_blank">Issues</a></div><div class="navbar-item"><a id="" href="https://observablehq.com/@neocartocnrs/geoviz" target="_blank">Demo</a></div><div class="navbar-item"><a id="" href="https://neocartocnrs.observablehq.cloud/cv/" target="_blank">Maintainer</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#circle">circle</a></div><div class="sidebar-section-children"><a href="global.html#create">create</a></div><div class="sidebar-section-children"><a href="global.html#draw">draw</a></div><div class="sidebar-section-children"><a href="global.html#effect/blur">effect/blur</a></div><div class="sidebar-section-children"><a href="global.html#effect/clipPath">effect/clipPath</a></div><div class="sidebar-section-children"><a href="global.html#effect/radialGradient">effect/radialGradient</a></div><div class="sidebar-section-children"><a href="global.html#effect/shadow">effect/shadow</a></div><div class="sidebar-section-children"><a href="global.html#footer">footer</a></div><div class="sidebar-section-children"><a href="global.html#graticule">graticule</a></div><div class="sidebar-section-children"><a href="global.html#grid/arbitrary">grid/arbitrary</a></div><div class="sidebar-section-children"><a href="global.html#grid/diamond">grid/diamond</a></div><div class="sidebar-section-children"><a href="global.html#grid/dot">grid/dot</a></div><div class="sidebar-section-children"><a href="global.html#grid/h3">grid/h3</a></div><div class="sidebar-section-children"><a href="global.html#grid/hexbin">grid/hexbin</a></div><div class="sidebar-section-children"><a href="global.html#grid/make">grid/make</a></div><div class="sidebar-section-children"><a href="global.html#grid/square">grid/square</a></div><div class="sidebar-section-children"><a href="global.html#grid/triangle">grid/triangle</a></div><div class="sidebar-section-children"><a href="global.html#halfcircle">halfcircle</a></div><div class="sidebar-section-children"><a href="global.html#header">header</a></div><div class="sidebar-section-children"><a href="global.html#legend/box">legend/box</a></div><div class="sidebar-section-children"><a href="global.html#legend/choro_horizontal">legend/choro_horizontal</a></div><div class="sidebar-section-children"><a href="global.html#legend/choro_vertical">legend/choro_vertical</a></div><div class="sidebar-section-children"><a href="global.html#legend/circles">legend/circles</a></div><div class="sidebar-section-children"><a href="global.html#legend/circles_half">legend/circles_half</a></div><div class="sidebar-section-children"><a href="global.html#legend/circles_nested">legend/circles_nested</a></div><div class="sidebar-section-children"><a href="global.html#legend/mushrooms">legend/mushrooms</a></div><div class="sidebar-section-children"><a href="global.html#legend/spikes">legend/spikes</a></div><div class="sidebar-section-children"><a href="global.html#legend/squares">legend/squares</a></div><div class="sidebar-section-children"><a href="global.html#legend/squares_nested">legend/squares_nested</a></div><div class="sidebar-section-children"><a href="global.html#legend/symbol_horizontal">legend/symbol_horizontal</a></div><div class="sidebar-section-children"><a href="global.html#legend/symbol_vertical">legend/symbol_vertical</a></div><div class="sidebar-section-children"><a href="global.html#legend/typo_horizontal">legend/typo_horizontal</a></div><div class="sidebar-section-children"><a href="global.html#legend/typo_vertical">legend/typo_vertical</a></div><div class="sidebar-section-children"><a href="global.html#north">north</a></div><div class="sidebar-section-children"><a href="global.html#outline">outline</a></div><div class="sidebar-section-children"><a href="global.html#path">path</a></div><div class="sidebar-section-children"><a href="global.html#plot">plot</a></div><div class="sidebar-section-children"><a href="global.html#plot/choro">plot/choro</a></div><div class="sidebar-section-children"><a href="global.html#plot/prop">plot/prop</a></div><div class="sidebar-section-children"><a href="global.html#plot/propchoro">plot/propchoro</a></div><div class="sidebar-section-children"><a href="global.html#plot/proptypo">plot/proptypo</a></div><div class="sidebar-section-children"><a href="global.html#plot/symbol">plot/symbol</a></div><div class="sidebar-section-children"><a href="global.html#plot/typo">plot/typo</a></div><div class="sidebar-section-children"><a href="global.html#render">render</a></div><div class="sidebar-section-children"><a href="global.html#scalebar">scalebar</a></div><div class="sidebar-section-children"><a href="global.html#spike">spike</a></div><div class="sidebar-section-children"><a href="global.html#square">square</a></div><div class="sidebar-section-children"><a href="global.html#symbol">symbol</a></div><div class="sidebar-section-children"><a href="global.html#text">text</a></div><div class="sidebar-section-children"><a href="global.html#tile">tile</a></div><div class="sidebar-section-children"><a href="global.html#tip">tip</a></div><div class="sidebar-section-children"><a href="global.html#tool/addonts">tool/addonts</a></div><div class="sidebar-section-children"><a href="global.html#tool/centroid">tool/centroid</a></div><div class="sidebar-section-children"><a href="global.html#tool/choro">tool/choro</a></div><div class="sidebar-section-children"><a href="global.html#tool/dissolve">tool/dissolve</a></div><div class="sidebar-section-children"><a href="global.html#tool/dodge">tool/dodge</a></div><div class="sidebar-section-children"><a href="global.html#tool/dotstogrid">tool/dotstogrid</a></div><div class="sidebar-section-children"><a href="global.html#tool/featurecollection">tool/featurecollection</a></div><div class="sidebar-section-children"><a href="global.html#tool/geotable">tool/geotable</a></div><div class="sidebar-section-children"><a href="global.html#tool/height">tool/height</a></div><div class="sidebar-section-children"><a href="global.html#tool/merge">tool/merge</a></div><div class="sidebar-section-children"><a href="global.html#tool/proj4d3">tool/proj4d3</a></div><div class="sidebar-section-children"><a href="global.html#tool/project">tool/project</a></div><div class="sidebar-section-children"><a href="global.html#tool/radius">tool/radius</a></div><div class="sidebar-section-children"><a href="global.html#tool/random">tool/random</a></div><div class="sidebar-section-children"><a href="global.html#tool/replicate">tool/replicate</a></div><div class="sidebar-section-children"><a href="global.html#tool/rewind">tool/rewind</a></div><div class="sidebar-section-children"><a href="global.html#tool/ridge">tool/ridge</a></div><div class="sidebar-section-children"><a href="global.html#tool/symbols">tool/symbols</a></div><div class="sidebar-section-children"><a href="global.html#tool/typo">tool/typo</a></div><div class="sidebar-section-children"><a href="global.html#tool/unproject">tool/unproject</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
Loading

0 comments on commit da04dc5

Please sign in to comment.