(gd, trace)
| 32 | var appendArrayPointValue = require('../../components/fx/helpers').appendArrayPointValue; |
| 33 | |
| 34 | function convertStyle(gd, trace) { |
| 35 | var i; |
| 36 | |
| 37 | var opts = { |
| 38 | marker: undefined, |
| 39 | markerSel: undefined, |
| 40 | markerUnsel: undefined, |
| 41 | line: undefined, |
| 42 | fill: undefined, |
| 43 | errorX: undefined, |
| 44 | errorY: undefined, |
| 45 | text: undefined, |
| 46 | textSel: undefined, |
| 47 | textUnsel: undefined |
| 48 | }; |
| 49 | |
| 50 | var plotGlPixelRatio = gd._context.plotGlPixelRatio; |
| 51 | |
| 52 | if (trace.visible !== true) return opts; |
| 53 | |
| 54 | if (subTypes.hasText(trace)) { |
| 55 | opts.text = convertTextStyle(gd, trace); |
| 56 | opts.textSel = convertTextSelection(gd, trace, trace.selected); |
| 57 | opts.textUnsel = convertTextSelection(gd, trace, trace.unselected); |
| 58 | } |
| 59 | |
| 60 | if (subTypes.hasMarkers(trace)) { |
| 61 | opts.marker = convertMarkerStyle(gd, trace); |
| 62 | opts.markerSel = convertMarkerSelection(gd, trace, trace.selected); |
| 63 | opts.markerUnsel = convertMarkerSelection(gd, trace, trace.unselected); |
| 64 | |
| 65 | if (!trace.unselected && isArrayOrTypedArray(trace.marker.opacity)) { |
| 66 | var mo = trace.marker.opacity; |
| 67 | opts.markerUnsel.opacity = new Array(mo.length); |
| 68 | for (i = 0; i < mo.length; i++) { |
| 69 | opts.markerUnsel.opacity[i] = DESELECTDIM * mo[i]; |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | if (subTypes.hasLines(trace)) { |
| 75 | opts.line = { |
| 76 | overlay: true, |
| 77 | thickness: trace.line.width * plotGlPixelRatio, |
| 78 | color: trace.line.color, |
| 79 | opacity: trace.opacity |
| 80 | }; |
| 81 | |
| 82 | var dashes = (constants.DASHES[trace.line.dash] || [1]).slice(); |
| 83 | for (i = 0; i < dashes.length; ++i) { |
| 84 | dashes[i] *= trace.line.width * plotGlPixelRatio; |
| 85 | } |
| 86 | opts.line.dashes = dashes; |
| 87 | } |
| 88 | |
| 89 | if (trace.error_x && trace.error_x.visible) { |
| 90 | opts.errorX = convertErrorBarStyle(trace, trace.error_x, plotGlPixelRatio); |
| 91 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…