MCPcopy Index your code
hub / github.com/plotly/plotly.js / mockAxis

Function mockAxis

src/traces/indicator/plot.js:808–839  ·  view source on GitHub ↗
(gd, opts, zrange)

Source from the content-addressed store, hash-verified

806
807// mocks our axis
808function mockAxis(gd, opts, zrange) {
809 var fullLayout = gd._fullLayout;
810
811 var axisIn = Lib.extendFlat({
812 type: 'linear',
813 ticks: 'outside',
814 range: zrange,
815 showline: true
816 }, opts);
817
818 var axisOut = {
819 type: 'linear',
820 _id: 'x' + opts._id
821 };
822
823 var axisOptions = {
824 letter: 'x',
825 font: fullLayout.font,
826 noAutotickangles: true,
827 noHover: true,
828 noTickson: true
829 };
830
831 function coerce(attr, dflt) {
832 return Lib.coerce(axisIn, axisOut, axisLayoutAttrs, attr, dflt);
833 }
834
835 handleAxisDefaults(axisIn, axisOut, coerce, axisOptions, fullLayout);
836 handleAxisPositionDefaults(axisIn, axisOut, coerce, axisOptions);
837
838 return axisOut;
839}
840
841function fitTextInsideBox(textBB, width, height) {
842 // compute scaling ratio to have text fit within specified width and height

Callers 5

drawBulletGaugeFunction · 0.85
drawAngularGaugeFunction · 0.85
transitionFormatFunction · 0.85
drawBignumberFunction · 0.85
drawDeltaFunction · 0.85

Calls 1

handleAxisDefaultsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…