(props)
| 3096 | var _legends = require("./legends"); |
| 3097 | var _top = require("./top"); |
| 3098 | function addColor(props) { |
| 3099 | const { colorReverseSignalName , dataName , scope , legendDataName , scaleName , specContext , topLookupName } = props; |
| 3100 | let colorDataName = dataName; |
| 3101 | const { insight , specColumns , specViewOptions } = specContext; |
| 3102 | const legends = (0, _legends.getLegends)(specContext, scaleName); |
| 3103 | if (legends) scope.legends = legends; |
| 3104 | const categoricalColor = specColumns.color && !specColumns.color.quantitative; |
| 3105 | if (categoricalColor) { |
| 3106 | (0, _scope.addData)(scope, ...(0, _top.topLookup)(specColumns.color, specViewOptions.maxLegends, dataName, legendDataName, topLookupName, (0, _constants.FieldNames).TopColor, (0, _constants.FieldNames).TopIndex)); |
| 3107 | colorDataName = legendDataName; |
| 3108 | } |
| 3109 | if (specColumns.color && !specColumns.color.isColorData && !insight.directColor) { |
| 3110 | if (specColumns.color.quantitative) (0, _scope.addScales)(scope, (0, _scales.binnableColorScale)(scaleName, insight.colorBin, dataName, specColumns.color.name, insight.scheme)); |
| 3111 | else (0, _scope.addScales)(scope, { |
| 3112 | name: scaleName, |
| 3113 | type: "ordinal", |
| 3114 | domain: { |
| 3115 | data: colorDataName, |
| 3116 | field: (0, _constants.FieldNames).TopColor, |
| 3117 | sort: true |
| 3118 | }, |
| 3119 | range: { |
| 3120 | scheme: insight.scheme || (0, _constants.ColorScaleNone) |
| 3121 | }, |
| 3122 | reverse: { |
| 3123 | signal: colorReverseSignalName |
| 3124 | } |
| 3125 | }); |
| 3126 | } |
| 3127 | (0, _scope.addSignals)(scope, (0, _signals.colorBinCountSignal)(specContext), (0, _signals.colorReverseSignal)(specContext)); |
| 3128 | return { |
| 3129 | topColorField: (0, _constants.FieldNames).TopColor, |
| 3130 | colorDataName |
| 3131 | }; |
| 3132 | } |
| 3133 | |
| 3134 | },{"./scope":"91ogX","./scales":"1eNTN","./signals":"62U7A","./constants":"9PPhV","./legends":"7bxMX","./top":"cunao","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"1eNTN":[function(require,module,exports) { |
| 3135 | var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); |
nothing calls this directly
no test coverage detected