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

Function getDragPositions

test/jasmine/tests/parcats_test.js:770–796  ·  view source on GitHub ↗
(parcatsViewModel)

Source from the content-addressed store, hash-verified

768 afterEach(destroyGraphDiv);
769
770 function getDragPositions(parcatsViewModel) {
771 var dragDimStartX = parcatsViewModel.dimensions[1].x;
772
773 var mouseStartY = parcatsViewModel.y + parcatsViewModel.dimensions[1].categories[2].y + 10;
774 var mouseStartX = parcatsViewModel.x + dragDimStartX + dimWidth / 2;
775
776 // Pause mouse half-way between the original location of
777 // the first and second dimensions. Also move mouse
778 // upward enough to swap position with middle category
779 var mouseMidY = parcatsViewModel.y + parcatsViewModel.dimensions[1].categories[1].y;
780 var mouseMidX = mouseStartX + dimDx / 2;
781
782 // End mouse drag in the middle of the original
783 // position of the dimension label of the third dimension
784 // (dimension display index 2), and at the height of the original top category
785 var mouseEndY = parcatsViewModel.y;
786 var mouseEndX = parcatsViewModel.x + parcatsViewModel.dimensions[2].x + dimWidth / 2;
787 return {
788 dragDimStartX: dragDimStartX,
789 mouseStartY: mouseStartY,
790 mouseStartX: mouseStartX,
791 mouseMidY: mouseMidY,
792 mouseMidX: mouseMidX,
793 mouseEndY: mouseEndY,
794 mouseEndX: mouseEndX
795 };
796 }
797
798 function checkInitialDimensions() {
799 checkDimensionCalc(gd, 0,

Callers 1

parcats_test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…