Giter Club home page Giter Club logo

d3plus-viz's Introduction

d3plus-viz

Abstract ES6 class that drives d3plus visualizations.

Installing

If using npm, npm install d3plus-viz. Otherwise, you can download the latest release from GitHub or load from a CDN.

import modules from "d3plus-viz";

d3plus-viz can be loaded as a standalone library or bundled as part of D3plus. ES modules, AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3plus global is exported:

<script src="https://cdn.jsdelivr.net/npm/d3plus-viz@1"></script>
<script>
  console.log(d3plus);
</script>

Examples

Live examples can be found on d3plus.org, which includes a collection of example visualizations using d3plus-react. These examples are powered by the d3plus-storybook repo, and PRs are always welcome. 🍻

API Reference

  • isData - Adds the provided value to the internal queue to be loaded, if necessary. This is used internally in new d3plus visualizations that fold in additional data sources, like the nodes and links of Network or the topojson of Geomap.
  • dataConcat - Reduce and concat all the elements included in arrayOfArrays if they are arrays. If it is a JSON object try to concat the array under given key data. If the key doesn't exists in object item, a warning message is lauched to the console. You need to implement DataFormat callback to concat the arrays manually.
  • dataFold - Given a JSON object where the data values and headers have been split into separate key lookups, this function will combine the data values with the headers and returns one large array of objects.
  • isData - Returns true/false whether the argument provided to the function should be loaded using an internal XHR request. Valid data can either be a string URL or an Object with "url" and "headers" keys.
  • dataLoad - Loads data from a filepath or URL, converts it to a valid JSON object, and returns it to a callback function.
  • defaultPadding - Default padding logic that will return false if the screen is less than 600 pixels wide.
  • listify - Turns an array of values into a list string.
  • _thresholdFunction - Applies the threshold algorithm according to the type of chart used.

Viz <>

This is a global class, and extends all of the methods and functionality of BaseClass.

# new Viz()

Creates an x/y plot based on an array of data. If data is specified, immediately draws the tree map based on the specified array and returns the current class instance. If data is not specified on instantiation, it can be passed/updated after instantiation using the data method. See this example for help getting started using the treemap generator.

# Viz.render([callback]) <>

Draws the visualization given the specified configuration.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.active([value]) <>

If value is specified, sets the active method to the specified function and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.aggs([value]) <>

If value is specified, sets the aggregation method for each key in the object and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.ariaHidden([value]) <>

Sets the "aria-hidden" attribute of the containing SVG element. The default value is "false", but it you need to hide the SVG from screen readers set this property to "true".

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.attribution(value) <>

Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.attributionStyle([value]) <>

If value is specified, sets the config method for the back button and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.backConfig([value]) <>

If value is specified, sets the config method for the back button and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.cache([value]) <>

Enables a lru cache that stores up to 5 previously loaded files/URLs. Helpful when constantly writing over the data array with a URL in the render function of a react component.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.color([value]) <>

Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.colorScale([value]) <>

Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.colorScaleConfig([value]) <>

A pass-through to the config method of ColorScale.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.colorScalePadding([value]) <>

Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.colorScalePosition([value]) <>

Defines which side of the visualization to anchor the color scale. Acceptable values are "top", "bottom", "left", "right", and false. A false value will cause the color scale to not be displayed, but will still color shapes based on the scale.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.colorScaleMaxSize([value]) <>

Sets the maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.data(data, [formatter]) <>

Sets the primary data array to be used when drawing the visualization. The value passed should be an Array of objects or a String representing a filepath or URL to be loaded. The following filetypes are supported: csv, tsv, txt, and json.

If your data URL needs specific headers to be set, an Object with "url" and "headers" keys may also be passed.

Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final array of obejcts to be used as the primary data array. For example, some JSON APIs return the headers split from the data values to save bandwidth. These would need be joined using a custom formatter.

If you would like to specify certain configuration options based on the yet-to-be-loaded data, you can also return a full config object from the data formatter (including the new data array as a key in the object).

If data is not specified, this method returns the current primary data array, which defaults to an empty array ([]);

This is a static method of Viz, and is chainable with other methods of this Class.

Param Type Description
data Array | String = []
[formatter] function

# Viz.dataCutoff([value]) <>

If the number of visible data points exceeds this number, the default hover behavior will be disabled (helpful for very large visualizations bogging down the DOM with opacity updates).

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.depth([value]) <>

If value is specified, sets the depth to the specified number and returns the current class instance. The value should correspond with an index in the groupBy array.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.detectResize(value) <>

If the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to true, the Viz will listen for the window.onresize event and adjust it's dimensions accordingly.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.detectResizeDelay(value) <>

When resizing the browser window, this is the millisecond delay to trigger the resize event.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.detectVisible(value) <>

Toggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to true, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.detectVisibleInterval(value) <>

The interval, in milliseconds, for checking if the visualization is visible on the page.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.discrete([value]) <>

If value is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.downloadButton([value]) <>

Shows a button that allows for downloading the current visualization.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.downloadConfig([value]) <>

Sets specific options of the saveElement function used when downloading the visualization.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.downloadPosition([value]) <>

Defines which control group to add the download button into.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.duration([ms]) <>

If ms is specified, sets the animation duration to the specified number and returns the current class instance. If ms is not specified, returns the current animation duration.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.filter([value]) <>

If value is specified, sets the filter to the specified function and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.groupBy([value]) <>

If value is specified, sets the group accessor(s) to the specified string, function, or array of values and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

function value(d) {
  return d.id;
}

# Viz.height([value]) <>

If value is specified, sets the overall height to the specified number and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.hiddenColor([value]) <>

Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.hiddenOpacity([value]) <>

Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.hover([value]) <>

If value is specified, sets the hover method to the specified function and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.label([value]) <>

If value is specified, sets the label accessor to the specified function or string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legend([value]) <>

If value is specified, toggles the legend based on the specified boolean and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendConfig([value]) <>

If value is specified, the object is passed to the legend's config method.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendFilterInvert([value]) <>

Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking with solo that category and shift+clicking will hide that category.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendPadding([value]) <>

Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendPosition([value]) <>

Defines which side of the visualization to anchor the legend. Expected values are "top", "bottom", "left", and "right".

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendSort(value) <>

A JavaScript sort comparator function used to sort the legend.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.legendTooltip([value]) <>

If value is specified, sets the config method for the legend tooltip and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.loadingHTML([value]) <>

Sets the inner HTML of the status message that is displayed when loading AJAX requests and displaying errors. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.loadingMessage([value]) <>

Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.messageMask([value]) <>

Sets the color of the mask used underneath the status message that is displayed when loading AJAX requests and displaying errors. Additionally, false will turn off the mask completely.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.messageStyle([value]) <>

Defines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.noDataHTML([value]) <>

Sets the inner HTML of the status message that is displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.noDataMessage([value]) <>

Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.resizeContainer(selector) <>

If using resize detection, this method allow a custom override of the element to which the resize detection function gets attached.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.scrollContainer(selector) <>

If using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.select([selector]) <>

If selector is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If selector is not specified, returns the current SVG container element, which is undefined by default.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.shape([value]) <>

If value is specified, sets the shape accessor to the specified function or number and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.shapeConfig([value]) <>

If value is specified, sets the config method for each shape and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.subtitle([value]) <>

If value is specified, sets the subtitle accessor to the specified function or string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.subtitleConfig([value]) <>

If value is specified, sets the config method for the subtitle and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.subtitlePadding([value]) <>

Tells the subtitle whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the subtitle appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.svgDesc([value]) <>

If value is specified, sets the description accessor to the specified string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.svgTitle([value]) <>

If value is specified, sets the title accessor to the specified string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.threshold([value]) <>

If value is specified, sets the threshold for buckets to the specified function or string, and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.thresholdKey([value]) <>

If value is specified, sets the accesor for the value used in the threshold algorithm, and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.thresholdName([value]) <>

If value is specified, sets the label for the bucket item, and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.time([value]) <>

If value is specified, sets the time accessor to the specified function or string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.timeFilter([value]) <>

If value is specified, sets the time filter to the specified function and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.timeline([value]) <>

If value is specified, toggles the timeline based on the specified boolean and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.timelineConfig([value]) <>

If value is specified, sets the config method for the timeline and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.timelineDefault([value]) <>

Sets the starting time or range for the timeline. The value provided can either be a single Date/String, or an Array of 2 values representing the min and max.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.timelinePadding([value]) <>

Tells the timeline whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the timeline appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.title([value]) <>

If value is specified, sets the title accessor to the specified function or string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.titleConfig([value]) <>

If value is specified, sets the config method for the title and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.titlePadding([value]) <>

Tells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.tooltip([value]) <>

If value is specified, toggles the tooltip based on the specified boolean and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.tooltipConfig([value]) <>

If value is specified, sets the config method for the tooltip and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.total([value]) <>

If value is specified, sets the total accessor to the specified function or string and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.totalConfig([value]) <>

If value is specified, sets the config method for the total and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.totalFormat(value) <>

Formatter function for the value in the total bar.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.totalPadding([value]) <>

Tells the total whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the total appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.width([value]) <>

If value is specified, sets the overallwidth to the specified number and returns the current class instance.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoom(value) <>

Toggles the ability to zoom/pan the visualization. Certain parameters for zooming are required to be hooked up on a visualization by visualization basis.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomBrushHandleSize(value) <>

The pixel stroke-width of the zoom brush area.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomBrushHandleStyle(value) <>

An object containing CSS key/value pairs that is used to style the outer handle area of the zoom brush. Passing false will remove all default styling.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomBrushSelectionStyle(value) <>

An object containing CSS key/value pairs that is used to style the inner selection area of the zoom brush. Passing false will remove all default styling.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomControlStyle(value) <>

An object containing CSS key/value pairs that is used to style each zoom control button (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomControlStyleActive(value) <>

An object containing CSS key/value pairs that is used to style each zoom control button when active (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomControlStyleHover(value) <>

An object containing CSS key/value pairs that is used to style each zoom control button on hover (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomFactor(value) <>

The multiplier that is used in with the control buttons when zooming in and out.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomMax(value) <>

If value is specified, sets the max zoom scale to the specified number and returns the current class instance. If value is not specified, returns the current max zoom scale.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomPan(value) <>

If value is specified, toggles panning to the specified boolean and returns the current class instance. If value is not specified, returns the current panning value.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomPadding(value) <>

A pixel value to be used to pad all sides of a zoomed area.

This is a static method of Viz, and is chainable with other methods of this Class.

# Viz.zoomScroll([value]) <>

If value is specified, toggles scroll zooming to the specified boolean and returns the current class instance. If value is not specified, returns the current scroll zooming value.

This is a static method of Viz, and is chainable with other methods of this Class.


d3plus.isData(data, [data], data) <>

Adds the provided value to the internal queue to be loaded, if necessary. This is used internally in new d3plus visualizations that fold in additional data sources, like the nodes and links of Network or the topojson of Geomap.

This is a global function.

Param Type Description
data Array | String | Object The data to be loaded
[data] function An optional data formatter/callback
data String The internal Viz method to be modified

d3plus.dataConcat(arrayOfArray, [data]) <>

Reduce and concat all the elements included in arrayOfArrays if they are arrays. If it is a JSON object try to concat the array under given key data. If the key doesn't exists in object item, a warning message is lauched to the console. You need to implement DataFormat callback to concat the arrays manually.

This is a global function.

Param Type Default Description
arrayOfArray Array Array of elements
[data] String "data" The key used for the flat data array if exists inside of the JSON object.

d3plus.dataFold(json, [data], [headers]) <>

Given a JSON object where the data values and headers have been split into separate key lookups, this function will combine the data values with the headers and returns one large array of objects.

This is a global function.

Param Type Default Description
json Object A JSON data Object with data and headers keys.
[data] String "data" The key used for the flat data array inside of the JSON object.
[headers] String "headers" The key used for the flat headers array inside of the JSON object.

d3plus.isData(dataItem) <>

Returns true/false whether the argument provided to the function should be loaded using an internal XHR request. Valid data can either be a string URL or an Object with "url" and "headers" keys.

This is a global function.


d3plus.dataLoad(path, [formatter], [key], [callback]) <>

Loads data from a filepath or URL, converts it to a valid JSON object, and returns it to a callback function.

This is a global function.

Param Type Description
path Array | String The path to the file or url to be loaded. Also support array of paths strings. If an Array of objects is passed, the xhr request logic is skipped.
[formatter] function An optional formatter function that is run on the loaded data.
[key] String The key in the this context to save the resulting data to.
[callback] function A function that is called when the final data is loaded. It is passed 2 variables, any error present and the data loaded.

d3plus.defaultPadding() <>

Default padding logic that will return false if the screen is less than 600 pixels wide.

This is a global function.


d3plus.listify() <>

Turns an array of values into a list string.

This is a global function.


d3plus._thresholdFunction(data) <>

Applies the threshold algorithm according to the type of chart used.

This is a global function.


Documentation generated on Tue, 12 Mar 2024 20:21:54 GMT

d3plus-viz's People

Contributors

cnavarreteliz avatar davelandry avatar ffigueroal avatar frabarz avatar greenkeeper[bot] avatar greenkeeperio-bot avatar nbond211 avatar palamago avatar rbaheti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

d3plus-viz's Issues

add "no data available" message

Expected Behavior

If there is no data available, the visualization should say as such! Should be able to use the message constructor used for the loading message. A few different cases will need to be tested:

  • failed XHR request
  • false value
  • empty Array
  • implement a class variable that allows specific visualizations that allow empty data to disable this behavior (ie. d3plus-geomap and d3plus-network). probably something internal like this._dataRequired = true;

Current Behavior

Visualization either fails, show's a blank screen, or shows the previous data.

Steps to Reproduce (for bugs)

  1. Pass a full data array to .data() and render
  2. Pass false or [] or a failing XHR request to .data() and render

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: macOS Sierra

tooltip persists after user-defined click event

Expected Behavior

When supplying a custom click event, the tooltip that is being displayed persists on the page.

Current Behavior

The tooltip persists, which ends up being really weird if the click event links to another page.

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: macOS High Sierra

allow visualizations to provide margins for the legend

Expected Behavior

Visualizations should specifically be able to override a default "legend margin", which should default to something like this: this._legendMargin = {top: 0, right: 0, bottom: 0, left: 0}. This would allow for d3plus-plot to adjust the positioning of the legend so that it aligns with the axes (as mentioned in this issue: d3plus/d3plus-plot#75).

Current Behavior

There is currently no additional legend margin properties, as it just uses the available width/height.

An in-range update of d3-transition is breaking the build 🚨

Version 1.0.4 of d3-transition just got published.

Branch Build failing 🚨
Dependency d3-transition
Current Version 1.0.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As d3-transition is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v1.0.4
  • Fix string coercion in transition.style and transition.attr. Thanks, @sghall! (#67)
  • Update dependencies.
Commits

The new version differs by 4 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

When label in legend is hidden a "false" tooltip is shown

Set your legendConfig.label on false and the tooltip text is "false".

legendConfig: {
      label: false
}

Complete chart Config example:

                <Treemap
                        config={{
                            height: 500,
                            data: path,
                            groupBy: ["ID HS0", "ID HS2"],
                            label: d =>
                                d["HS2"] instanceof Array ? d["HS0"] : d["HS2"],
                            sum: d => d["FOB US"],
                            time: "ID Year",
                            legendConfig: {
                                label: false,
                                shapeConfig:{
                                    width:25,
                                    height:25,
                                    fill: d => ordinalColorScale(d["ID HS0"]),
                                    backgroundImage: d => "https://datausa.io/static/img/attrs/thing_apple.png",
                                }
                            },
                            shapeConfig: {
                                fill: d => ordinalColorScale(d["ID HS0"])
                            }
                        }}
                        dataFormat={data => data.data}
                    />

Expected Behavior

The tooltip should show the name of this legend even when not is rendered.

Current Behavior

When label in legend is hidden, a "false" hover-tooltip is shown.

Steps to Reproduce (for bugs)

sept-06-2017 12-34-17

Your Environment

  • Browser Name: chrome
  • Operating System and Version: OSX El Capitán

An in-range update of d3-color is breaking the build 🚨

Version 1.0.3 of d3-color just got published.

Branch Build failing 🚨
Dependency d3-color
Current Version 1.0.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As d3-color is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v1.0.3
  • Update dependencies.
Commits

The new version differs by 2 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Unexpected Legend Behavior in Treemap

I have a dataset of companies and their products. I created a Treemap and grouped the dataset by company and products.

If a company has only one product in the dataset, the Legend does not display the company's name but the product's.

I would expect the Legend to show the first level's identifier (here: company name) and not the second level's identifier.

Example: http://jsfiddle.net/g149pjqo/3/

filter NaN values out of data

[
    {value: 10, id: "alpha"},
    {value: 30, id: "alpha"},
    {value: 50, id: "alpha"},
    {value: 20, id: "beta"},
    {value: 40, id: "beta"},
    {value: NaN, id: "beta"}
]

In datasets received by d3plus, filter the nan values.

implement data threshold grouping

d3plus 1.0 has a feature that groups data under a certain percentage ("threshold") into an "Values < X%" category. This should be implemented in the new d3plus:

  • a threshold method that accepts a Number or an accessor Function
  • a thresholdKey method that tells d3plus-viz what value to use (accepts a String or a Function). It will then be on each visualization (ie. Treemap) to set a default value for this method (ie. when a user defines sum, also define thresholdKey if it has not been defined.
  • grouping logic should be implemented after this line
  • if it is a Function, pass the function the flatData and expect a returned Number
  • add a key to the nest that nests any data that has a thresholdKey less than that the overall total for that group and give it a different key

broken legend label behavior with lots of elements

When too many (how many?) Legend Items are to be displayed, the Legend Labels are truncated. This leads to Legend Items without a Label and the Tooltip Data passed in tooltipConfig Callback Function is mixed up.

I would expect the Legend Items to be grouped as specified in groupBy.

Example: http://jsfiddle.net/g149pjqo/4/ (have the JS-Console opened and hover over Legend Items without a label)

jenks scale breaks when data array is empty

Expected Behavior

When passing am empty data array to a visualization that supports no data (like Network or Geomap), the visualization should draw regardless of any properties past to colorScaleConfig.

Current Behavior

When setting .colorScaleConfig({scale: "jenks"}) with an empty array ("linear" works), the visualization never gets past the loading screen.

Steps to Reproduce (for bugs)

https://jsfiddle.net/bk7jLeyn/6/

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: macOS High Sierra

changing .colorScale() breaks viz

When I have a switch for to toggle the colorScale, I can't to disable the colorScale in the second instance.

Expected Behavior

I should be able to change the data provided to colorScale()

Current Behavior

The color scale rendered in the first instance is maintained.

Steps to Reproduce (for bugs)

  1. https://jsfiddle.net/2ut5gyd7/2/

Your Environment

  • Browser Name: Google Chrome
  • Operating System and Version: MacOS Mojave

implement opt-in viz tracking

On opting in, d3plus-viz could collect statistics on usage and bugs from users, as well as populate a "Most Viewed Showcase" on d3plus.org

better accessibility support

The following features should be implemented for better accessibility and 508 compliance:

  • d3plus/d3plus-shape#78
  • d3plus/d3plus-shape#79
  • d3plus/d3plus-text#89
  • add a <title id="${uuid}-title"> tag containing this._title || "D3plus Visualization" (docs on SVG titles, code will probably need to be inserted here)
  • set ariaHidden: true on the visible TextBox chart title (should be able to add to titleConfig here)
  • add a <desc id="${uuid}-desc"> tag mapped to a new desc method and this._desc (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc) on SVG titles, code will probably need to be inserted here)
  • add aria-labelledby="${this._uuid}-title ${this._uuid}-desc" to the <svg> container (SVG is modified here)
  • add role="img" to the <svg> container (SVG is modified here)
  • add role="presentation" to all shapes (can probably be added to the shapeConfig here)
  • set ariaLabel for all shapes to the drawLabel (to be overridden by charts as necessary) (can probably be added to the shapeConfig here)
  • set ariaLabel for all legend shapes to the legendLabel (can probably be added to the legendConfig here)

changing .total() causes error

Expected Behavior

I should be able to change the data provided to .total( ).

Current Behavior

Currently, the first .total() behavior calculated is maintained.

Steps to Reproduce (for bugs)

  1. https://jsfiddle.net/q3gbn0tk/

Your Environment

  • Browser Name: Google Chrome
  • Operating System and Version: MacOS High Sierra

Geomap requests topojson file on each render

What the title says. The problem happens when using a Geomap component from d3plus-react, but the cause likely comes from the way the config object is handled.

Expected Behavior

In a react component, after recreating the config object, but without changing the topojson value, the visualization should refresh using the same topojson already loaded in memory.

Current Behavior

image

On any render call, after the config object is recreated, a new request for the topojson file is triggered.

Steps to Reproduce (for bugs)

  1. Make a simple react component and include a Geomap component from d3plus-react.
  2. Set a config object for the Geomap inside the render() method, set a constant topojson value.
  3. Set another element in the component, so you can trigger further renderings.
  4. Trigger a render while checking on the Devtools to monitor XHR calls.

Your Environment

  • Browser Name: Opera 50
  • Operating System and Version: Manjaro Linux (x86_64; XFCE)

tooltips on mobile disappear immediately on tap

Expected Behavior

On mobile, would expect the tooltip to appear on tap and to remain visible until users closes or taps away

Current Behavior

On mobile, tooltip appears for a second and then disappears immediately

Steps to Reproduce (for bugs)

  1. View https://jsfiddle.net/kf5u88L5/ in mobile compatibility mode using Chrome

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: Android 7 & 8 (and can be replicated on desktop in chrome compatibility mode using OS X 10.13.4)

brush control icon not correctly loading on certain mobile devices

Expected Behavior

The brushing icon should be appear normally
screen shot 2018-04-04 at 10 06 15 am

Current Behavior

For users of Samsung Galaxy on Chrome using Android 7 the icon is not loading correctly
screenshot_20180404-082833

Steps to Reproduce (for bugs)

  1. See screenshot above (have not been able to reproduce in Chrome emulator)

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: Android v7.0

An in-range update of d3-array is breaking the build 🚨

Version 1.0.3 of d3-array just got published.

Branch Build failing 🚨
Dependency d3-array
Current Version 1.0.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As d3-array is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v1.0.3
  • Update dependencies.
Commits

The new version differs by 6 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of d3-selection is breaking the build 🚨

Version 1.0.5 of d3-selection just got published.

Branch Build failing 🚨
Dependency d3-selection
Current Version 1.0.4
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As d3-selection is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v1.0.5
  • Update dependencies.
Commits

The new version differs by 3 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

tooltips on mobile disappear immediately on tap when shape click handler is specified

Expected Behavior

On mobile, would expect the tooltip to appear on tap and to remain visible until users closes or taps away when a custom on click handler is also supplied. (I tried return'ing true / false within the click event callback to see if that would change anything but didn't seem to change anything, maybe that could be a way to signal whether default event should still take place?)

Current Behavior

On mobile, tooltip appears for a second and then disappears immediately

Steps to Reproduce (for bugs)

View https://jsfiddle.net/jdssgzq7/ in mobile compatibility mode using Chrome

Your Environment

Browser Name: Chrome
Operating System and Version: Android 7 & 8 (and can be replicated on desktop in chrome compatibility mode using OS X 10.13.4)

allow access to scroll timeout for detectVisible

Expected Behavior

Depending on the scroll behavior/duration of a site, it would be nice to have access to the timeout ms for detecting when the page has "stopped".

Current Behavior

Currently set internally to 1000ms.

Use d3plus-viz with Angular (4)

Hello

I'm developint an app and try to use d3plus-viz.
The framwork reconize the classes and fucntions, but when i load the data to show on the browser it only resize the 'div' in what the chart have to be show.

I've tried with that example and nothing:

var graph_viz = new Viz();

var connections = [
  { "source": "alpha", "target": "beta", "strength": 1.25 },
  { "source": "alpha", "target": "gamma", "strength": 2.463 },
  { "source": "beta", "target": "delta", "strength": 0.823 },
  { "source": "beta", "target": "epsilon", "strength": 1.563 },
  { "source": "zeta", "target": "gamma", "strength": 3.125 },
  { "source": "theta", "target": "gamma", "strength": 0.732 },
  { "source": "eta", "target": "gamma", "strength": 2.063 }
];

graph_viz
  .data(connections)
  //.color('green')
  //.select('#csk_graph')
  //.label('CSK Graph')
  .render();

new version of d3plus-timeline breaks viz

@cnavarreteliz clone this repo, do an npm i, and check out this example:

new d3plus.Viz()
  .data([
    {"year": 2010, "id": "alpha", "value": 20},
    {"year": 2011, "id": "beta", "value": 20},
    {"year": 2013, "id": "gamma", "value": 40}
  ])
  .time("year")
  .render();

An in-range update of d3-array is breaking the build 🚨

The dependency d3-array was updated from 1.2.4 to 1.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

d3-array is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

improve visualization title behavior

Right now if you hover over a bar on a bar chart the default visualization says "D3plus visualization".

screen shot 2018-07-31 at 10 00 37 am

Was wondering if we could do 2 things:

  1. By default, if no title is specified could that tooltip read "Bar chart visualization" or "Treemap visualization" ?
  2. Could we also add an option to allow users to specify override the tooltip label without having to necessarily render an additional visible title?

An in-range update of d3-queue is breaking the build 🚨

Version 3.0.4 of d3-queue just got published.

Branch Build failing 🚨
Dependency d3-queue
Current Version 3.0.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As d3-queue is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v3.0.4
  • Update dependencies.
Commits

The new version differs by 5 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of d3plus-format is breaking the build 🚨

The dependency d3plus-format was updated from 0.1.4 to 0.1.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

d3plus-format is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v0.1.5
Commits

The new version differs by 16 commits.

  • 7d602b2 updates documentation
  • 3ad8af0 adds tests to delimiters for multiple locales
  • 36e9e12 enables support to delimiters
  • f72e6c7 creates test for estonian and spanish format
  • 98fac7b uses formatLocale instead of format function
  • b3bf676 adds grouping property to locales
  • 00b5a15 uses d3.format() function
  • 6ba84bc updates locale definitions
  • 49bf27a removes isNaN() function
  • c631d1b adds support to separators
  • 36c4e40 updates test file
  • b1e683d updates jsDOC file
  • 6ebcd15 adds support to en-GB, es-LA, es-ES and et locales
  • a4c3faa enables custom formatters according the locale selected
  • 35460d0 adds custom locale formatters file

There are 16 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

error when disabling noDataMessage

Expected Behavior

If noDataMessage is set to false, there should be no status message on the screen once the data has finished loading.

Current Behavior

The loadingMessage is not being removed.

Steps to Reproduce (for bugs)

screen shot 2018-03-30 at 2 19 34 pm

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: macOS High Sierra

better timeline event handling

Expected Behavior

Currently, the visualization only updates during the "brush" event of the timeline, which creates a strange "double-click" responsiveness bug when brushing: false has been set. Additionally, if the user defines their own "brush" event, the internal behavior to update the visualization gets disabled.

Current Behavior

The visualization should also check to redraw on brush "end", in addition to triggering the user-defined events with the internal checks so that the user can keep the viz updating while adding their own custom behavior.

Steps to Reproduce (for bugs)

https://jsfiddle.net/wc3pv6bg/

Your Environment

  • Browser Name: Chrome
  • Operating System and Version: macOS High Sierra

How to go back from active state?

When I call the active function, I need to pass a function that returns a boolean: true for the viz to be active and false for it to be inactive, but how do I return to the original state, which is not active nor inactive?

"No Data Available" message not displaying

Expected Behavior

When no data ([], false, undefined) is passed to a viz and noDataMessage is set to true, that viz should display the "No Data Available" message.

Current Behavior

The viz displays the "Loading Visualization" instead of the "No Data Available Message"

Steps to Reproduce (for bugs)

https://jsfiddle.net/hc2rt9o3/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.