cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-550590%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550590%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%C2%BFEs%20posible%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20solo%20se%20active%20con%20el%20mouse%20hacia%20arriba%20o%20despu%C3%A9s%20de%20que%20se%20complete%20un%20evento%20de%20selecci%C3%B3n%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEl%20evento%20en%20tiempo%20real%20hace%20que%20la%20selecci%C3%B3n%20de%20arrastre%20de%20mi%20gr%C3%A1fico%20se%20retrase%20y%20hace%20que%20la%20experiencia%20del%20usuario%20sea%20desagradable.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHe%20ido%20tan%20lejos%20como%20para%20reescribir%20completamente%20un%20evento%20de%20selecci%C3%B3n%20en%20la%20ratonera%2C%20pero%20tengo%20problemas%20para%20aplicarlo%20a%20los%20histogramas%20y%20ni%20siquiera%20me%20encanta%20c%C3%B3mo%20funciona.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESatisfar%C3%ADa%20mis%20necesidades%20si%20pudiera%20usar%20el%20cuadro%20de%20selecci%C3%B3n%2C%20la%20herramienta%20%22Flecha%20(A)%22%20al%20mismo%20tiempo%20que%20la%20funci%C3%B3n%20de%20trampa%20para%20ratones%2C%20de%20modo%20que%20simplemente%20pudiera%20recoger%20mis%20filas%20seleccionadas%20al%20final%20del%20evento%20de%20trampa%20para%20ratones%20en%20lugar%20de%20disparar%20un%20mill%C3%B3n.%20eventos%20mientras%20arrastra%20el%20rat%C3%B3n.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECosas%20que%20no%20me%20gustan%3A%3CBR%20%2F%3E%20Cuanto%20m%C3%A1s%20tiempo%20mueva%20el%20mouse%20hacia%20abajo%20mientras%20selecciona%2C%20m%C3%A1s%20y%20m%C3%A1s%20secuencias%20de%20comandos%20de%20gr%C3%A1ficos%20in%C3%BAtiles%20se%20acumulan%20en%20el%20gr%C3%A1fico.%3C%2FP%3E%3CP%3EMe%20gustar%C3%ADa%20tener%20uno%20y%20s%C3%B3lo%20uno.%20Agregu%C3%A9%20un%20bucle%20al%20final%20para%20eliminarlos%20a%20todos%20del%20gr%C3%A1fico%2C%20por%20lo%20que%20parecen%20%22desvanecerse%22.%3CBR%20%2F%3E%20Podr%C3%ADa%20dejarlos%20all%C3%AD%2C%20pero%20agregan%20ruido%20visual%20al%20gr%C3%A1fico%20y%20no%20s%C3%A9%20qu%C3%A9%20sucede%20cuando%20obtienes%20demasiados.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEditar%3A%20cuando%20obtienes%20demasiados%2C%20comienzan%20a%20retrasarse.%20Puede%20ser%20m%C3%A1s%20r%C3%A1pido%20destruir%20el%20gr%C3%A1fico%20y%20reconstruirlo%20que%20hacer%20un%20bucle%20para%20eliminar%20los%20scripts%20de%20gr%C3%A1ficos%20sobrantes.%20Edici%C3%B3n%202%3A%20es%20mucho%20m%C3%A1s%20r%C3%A1pido%20destruir%20el%20gr%C3%A1fico%20y%20volver%20a%20crearlo%2C%20pero%20luego%20se%20restablece%20el%20zoom%2C%20por%20lo%20que%20tendr%C3%A9%20que%20capturar%20m%C3%A1s%20sobre%20el%20estado%20del%20gr%C3%A1fico%20para%20poder%20reconstruirlo%20y%20ocultar%20la%20actualizaci%C3%B3n%20del%20usuario.%3CBR%20%2F%3E%3CBR%20%2F%3E%20Obtuve%20las%20cosas%20de%20Shift%2Fcontrol%20clic%20para%20trabajar%2C%20simplemente%20se%20siente%20demasiado%20raro%20para%20la%20producci%C3%B3n.%20Especialmente%20el%20clic%20de%20control%20tiene%20este%20largo%20tiempo%20de%20retraso%20despu%C3%A9s%20de%20que%20levantas%20el%20mouse%20y%20el%20cuadro%20de%20selecci%C3%B3n%20persigue%20al%20mouse%20incluso%20cuando%20ya%20has%20soltado%20el%20bot%C3%B3n%2C%20creo%20que%20jmp%20est%C3%A1%20manejando%20un%20mont%C3%B3n%20de%20eventos%20de%20arrastre%20obsoletos%20mientras%20tanto%20antes%20de%20que%20deje%20de%20moverse.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EO%20simplemente%20descarte%20toda%20esta%20aventura%20y%20encuentre%20una%20manera%20de%20tener%20un%20controlador%20de%20estado%20de%20fila%20que%20se%20active%20con%20el%20mouse%20hacia%20arriba%20(eso%20ser%C3%ADa%20ideal).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEjemplos%20de%20los%20que%20tom%C3%A9%20prestado%20el%20c%C3%B3digo%3A%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.pega-analytics.co.uk%2Fblog%2Fsegmented-regression%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%20http%3A%2F%2Fwww.pega-analytics.co.uk%2Fblog%2Fsegmented-regression%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FQuick-way-to-compare-two-lists-and-identify-the-uncommon%2Ftd-p%2F5811%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FQuick-way-to-compare-two-lists-and-identify-the-uncommon%2Ftd-p%2F5811%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Adt%20%3D%20open(%22%24sample_data%5CIris.jmp%22)%3B%0AMY_GRAPH_BUILDER%20%3D%20Graph%20Builder(%0A%20Size(%20531%2C%20456%20)%2C%0A%20Show%20Control%20Panel(%200%20)%2C%0A%20Variables(%20X(%20%3ASepal%20length%20)%2C%20Y(%20%3ASepal%20width%20)%20)%2C%0A%20Elements(%20Points(%20X%2C%20Y%2C%20Legend(%203%20)%20)%20)%2C%0A%20%20SendToReport(%20%0A%20%20Dispatch(%7B%7D%2C%22Graph%20Builder%22%2C%0A%20%20%20FrameBox%2C%0A%20%20%20%7BAdd%20Graphics%20Script(MouseTrap(%20MouseDown(x%2Cy)%2C%20MouseUp(x%2Cy)))%7D%0A%20%20%20)%2C%0A%20%20%20)%2C%0A)%3B%0A%0A%0A%0A%0A%0A%2F%2FMOUSE%20STUFF%0Aget_box_dims%20%3D%20Function(%7BfirstX%2ClastX%2CfirstY%2ClastY%7D%2C%0Ashow(%22get_box_dims%22)%3B%0A%2F%2Fshow(firstX%2ClastX%2CfirstY%2ClastY%2Cmodifier_key)%3B%0A%0A%20If%20(lastX%26gt%3BfirstX%2C%0A%20max_x%20%3D%20lastX%3B%20min_x%20%3DfirstX%2C%0A%20max_x%20%3D%20firstX%3Bmin_x%20%3DlastX%2C%0A%20)%3B%0A%0A%20If%20(lastY%26gt%3BfirstY%2C%0A%20max_y%20%3D%20lastY%3B%20min_y%20%3DfirstY%2C%0A%20max_y%20%3D%20firstY%3Bmin_y%20%3DlastY%2C%0A%20)%3B%0A%0A%0Ashow(min_x%2Cmin_y%2Cmax_x%2Cmax_y)%3B%0Aevallist(%7Bmin_x%2Cmax_x%2Cmin_y%2Cmax_y%7D)%3B%0A)%3B%0A%0Ado_normal_select%20%3D%20Function(%7Bselect_range%7D%2C%0Ashow(%22normal_select%22)%3B%0A%0A%0Adt%20%26lt%3B%26lt%3B%20Select%20Where(%20%0A%0A%20AsColumn(%3ASepal%20length)%20%26gt%3B%3D%20select_range%5B1%5D%20%0A%20%26amp%3B%20AsColumn(%3ASepal%20length)%20%26lt%3B%3D%20select_range%5B2%5D%0A%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26gt%3B%3D%20select_range%5B3%5D%20%0A%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26lt%3B%3D%20select_range%5B4%5D%0A%20%0A%20)%3B%0A)%3B%0A%0Ado_shift_select%20%3D%20Function(%7Bselect_range%7D%2C%0A%20show(%22shift_select%22)%3B%0A%0A%0A%20new_rows_to_add%20%3D%20as%20list(dt%20%26lt%3B%26lt%3B%20Get%20Rows%20Where(%20%0A%0A%20%20AsColumn(%3ASepal%20length)%20%26gt%3B%3D%20select_range%5B1%5D%20%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20length)%20%26lt%3B%3D%20select_range%5B2%5D%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26gt%3B%3D%20select_range%5B3%5D%20%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26lt%3B%3D%20select_range%5B4%5D%0A%20%20%0A%20%20)%0A%20%20%20%0A%20)%3B%0A%0A%20if%20(length(new_rows_to_add)%20%26gt%3B%200%2C%0A%20curr_rows%20%3D%20as%20list(dt%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows)%3B%0A%20rows_to_select%20%3D%20curr_rows%20%7C%7C%20new_rows_to_add%3B%0A%20dt%20%26lt%3B%26lt%3B%20Select%20Rows(%20rows_to_select)%3B%0A%20)%3B%0A%20%20show(new_rows_to_add%2Clength(new_rows_to_add))%3B%0A)%3B%0A%0A%0Ado_ctrl_select%20%3D%20Function(%7Bselect_range%7D%2C%0A%20show(%22ctrl_select%22)%3B%0A%20%0A%20new_rows_to_subtract%20%3D%20associativearray(as%20list(dt%20%26lt%3B%26lt%3B%20Get%20Rows%20Where(%20%0A%0A%20%20AsColumn(%3ASepal%20length)%20%26gt%3B%3D%20select_range%5B1%5D%20%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20length)%20%26lt%3B%3D%20select_range%5B2%5D%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26gt%3B%3D%20select_range%5B3%5D%20%0A%20%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26lt%3B%3D%20select_range%5B4%5D%0A%20%20%0A%20%20)%0A%20%20%20%0A%20))%3B%0A%20%0A%20if%20(length(new_rows_to_subtract)%20%26gt%3B%200%2C%0A%20curr_rows%20%3D%20associativearray(as%20list(dt%20%26lt%3B%26lt%3B%20Get%20Selected%20Rows))%3B%0A%20show(%22current_rows_selected%22%2Clength(curr_rows))%3B%0A%20show(%22number_rows_to_subtract%22%2Clength(new_rows_to_subtract))%3B%0A%20intersection%3Dcurr_rows%3Bintersection%26lt%3B%3CINTERSECT%3E%3C%2FINTERSECT%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-550590%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EFusi%C3%B3n%20y%20limpieza%20de%20datos%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIngenier%C3%ADa%20de%20Calidad%20y%20Procesos%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eventanas%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550996%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550996%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDudo%20que%20esto%20est%C3%A9%20muy%20bien%20documentado%2C%20en%20cualquier%20lugar...%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1893%22%20target%3D%22_blank%22%3E%40Audrey_Shull%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EMouseTrap%20y%20la%20funci%C3%B3n%20Handle%20con%20un%20comportamiento%20similar%20no%20se%20ejecutan%20en%20l%C3%ADnea%20como%20Rect()%20y%20el%20otro%3CEM%3E%20normal%3C%2FEM%3E%20funciones%20de%20script%20de%20gr%C3%A1ficos%20como%20Rect().%3C%2FP%3E%0A%3CP%3ECuando%20el%20flujo%20de%20control%20en%20la%20secuencia%20de%20comandos%20de%20gr%C3%A1ficos%20pasa%20por%20Handle()%20o%20MouseTrap()%2C%20la%20funci%C3%B3n%20no%20hace%20nada%20en%20el%20caso%20de%20MouseTrap%20o%20dibuja%20un%20peque%C3%B1o%20rect%C3%A1ngulo%20en%20la%20posici%C3%B3n%20del%20controlador%20para%20Handle.%20Cuando%20hace%20clic%20en%20un%20gr%C3%A1fico%20con%20un%20script%20gr%C3%A1fico%2C%20JMP%20busca%20en%20el%20script%20las%20funciones%20MouseTrap%20o%20Handle%20y%20las%20llama%2C%20en%20orden%2C%20hasta%20que%20una%20de%20ellas%3CEM%3E%20acepta%3C%2FEM%3E%20el%20punto.%3C%2FP%3E%0A%3CP%3EEntonces%2C%20en%20su%20ejemplo%2C%20hasta%20que%20haga%20clic%2C%20el%20c%C3%B3digo%20que%20establece%20x0%20nunca%20se%20ha%20ejecutado.%20Pero%20el%20c%C3%B3digo%20Rect%20se%20ejecutar%C3%A1.%3C%2FP%3E%0A%3CP%3ECreo%20que%2C%20sin%20intentarlo%2C%20podr%C3%ADa%20tener%20varios%20Handles()%20seguidos%20de%20MouseTrap()%2C%20y%20JMP%20tomar%C3%ADa%20el%20punto%20de%20clic%20y%20lo%20pasar%C3%ADa%20a%20cada%20Handle()%20hasta%20que%20uno%20de%20ellos%20lo%20tome%2C%20o%20MouseTrap()%20que%20lo%20har%C3%A1.%20t%C3%B3malo%20siempre.%3C%2FP%3E%0A%3CP%3ERect()%20se%20puede%20usar%20en%20un%20bucle%20for%20para%20dibujar%20muchos%20rect%C3%A1ngulos.%20No%20puede%20crear%20varios%20identificadores%20colocando%20Handle(...)%20en%20un%20bucle.%20Si%20necesita%20crear%20una%20cantidad%20variable%20de%20identificadores%2C%20puede%20usar%20MouseTrap()%20y%20una%20lista%20de%20ubicaciones%20x%2Cy%20para%20buscar%2C%20o%20puede%20usar%20alguna%20forma%20de%20manipulaci%C3%B3n%20de%20expresiones%20para%20crear%20varias%20llamadas%20a%20Handle().%3C%2FP%3E%0A%3CP%3EEsto%20tambi%C3%A9n%20significa%20que%20MouseTrap%2FHandle%20debe%20estar%20en%20el%20script%20de%20gr%C3%A1ficos%2C%20no%20en%20una%20funci%C3%B3n%20de%20usuario%20a%20la%20que%20llama%20el%20script%20de%20gr%C3%A1ficos.%20Rect%2C%20por%20otro%20lado%2C%20puede%20estar%20en%20una%20funci%C3%B3n%20de%20usuario%20llamada%20desde%20el%20script%20de%20gr%C3%A1ficos.%3C%2FP%3E%0A%3CP%3ESi%20coloca%20dos%20MouseTraps%20en%20un%20script%20de%20gr%C3%A1ficos%2C%20creo%20que%20nunca%20se%20podr%C3%A1%20alcanzar%20el%20segundo%20porque%20el%20primero%20siempre%20aceptar%C3%A1%20el%20clic.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENew%20Window(%20%22Example%22%2C%0A%20%20%20%20exx%20%3D%2020%2C%0A%20%20%20%20exy%20%3D%2050%3B%0A%20%20%20%20Graph%20Box(%0A%20%20%20%20%20%20%20%20Frame%20Size(%20200%2C%20200%20)%2C%0A%20%20%20%20%20%20%20%20If(%200%2C%20%2F%2F%20note%20that%20it%20still%20works%0A%20%20%20%20%20%20%20%20%20%20%20%20Mousetrap(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exx%20%3D%20x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20exy%20%3D%20y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20Circle(%20%7B0%2C%200%7D%2C%20Sqrt(%20exx%20*%20exx%20%2B%20exy%20*%20exy%20)%20)%3B%0A%20%20%20%20)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550958%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550958%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEsto%20hizo%20una%20gran%20mejora.%20%C2%A1Gracias!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550914%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550914%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIntent%C3%A9%20esto%20pero%20consegu%C3%AD.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0Agb%20%3D%20dt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%20Size(529%2C%20457)%2C%0A%20Show%20Control%20Panel(0)%2C%0A%20Variables(X(%3Aweight)%2C%20Y(%3Aheight))%2C%0A%20Elements(Points(X%2C%20Y%2C%20Legend(3)))%0A)%3B%0Afb%20%3D%20Report(gb)%5BFrameBox(1)%5D%3B%0A%0Ai%20%3D%200%3B%0Afb%20%26lt%3B%26lt%3B%20Add%20Graphics%20Script(%0A%20Mousetrap(%0A%20%20If(i%20%3D%3D%200%2C%0A%20%20%20x0%20%3D%20x%3B%20y0%20%3D%20y%3B%0A%20%20)%3B%0A%20%20exx%20%3D%20x%3B%20exy%20%3D%20y%3B%0A%20%20i%2B%2B%3B%0A%20%2C%20%0A%20%20i%20%3D%200%3B%0A%20%20show(%22RELEASED%22)%3B%0A%20)%3B%0A%20Rect(x0%2C%20y0%2C%20exx%2C%20exy)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ENombre%20Sin%20resolver%3A%20x0%20en%20acceso%20o%20evaluaci%C3%B3n%20de%20'x0'%2C%20x0%2F*%23%23%23*%2F%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Een%20la%20l%C3%ADnea%2024%20en%20Script%202.jsl%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENo%20estoy%20muy%20familiarizado%20con%20la%20ratonera()%3B%20funci%C3%B3n%2C%20%C2%BFno%20necesita%202x%20funciones%20internas%3F%3CBR%20%2F%3E%20Trampa%20del%20Rat%C3%B3n(%20Rat%C3%B3nAbajo(x%2Cy)%2C%20Rat%C3%B3nArriba(x%2Cy)))%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESin%20embargo%2C%20quiero%20resolver%20esto%20porque%20creo%20que%20gran%20parte%20de%20mi%20retraso%20proviene%20de%20transmitir%20los%20puntos%20en%20listas%202x%20y%20luego%20seleccionar%20el%20primero%20y%20el%20%C3%BAltimo%20de%20esas%20listas.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESimplemente%20usar%C3%ADa%20el%20bot%C3%B3n%20(eso%20es%20lo%20que%20he%20hecho)%2C%20pero%20tal%20vez%20se%20podr%C3%ADa%20construir%20algo%20con%20MouseTrap%20(%C2%BFo%20MouseBox%3F)%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0Agb%20%3D%20dt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%20Size(529%2C%20457)%2C%0A%20Show%20Control%20Panel(0)%2C%0A%20Variables(X(%3Aweight)%2C%20Y(%3Aheight))%2C%0A%20Elements(Points(X%2C%20Y%2C%20Legend(3)))%0A)%3B%0Afb%20%3D%20Report(gb)%5BFrameBox(1)%5D%3B%0A%0Ai%20%3D%200%3B%0Afb%20%26lt%3B%26lt%3B%20Add%20Graphics%20Script(%0A%20Mousetrap(%0A%20%20If(i%20%3D%3D%200%2C%0A%20%20%20x0%20%3D%20x%3B%20y0%20%3D%20y%3B%0A%20%20)%3B%0A%20%20exx%20%3D%20x%3B%20exy%20%3D%20y%3B%0A%20%20i%2B%2B%3B%0A%20%2C%20%0A%20%20i%20%3D%200%3B%0A%20%20show(%22RELEASED%22)%3B%0A%20)%3B%0A%20Rect(x0%2C%20y0%2C%20exx%2C%20exy)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550894%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550894%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEs%20s%C3%BAper%20lento.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEstoy%20tratando%20de%20transmitir%20solicitudes%20http%20desde%20JSL%20a%20un%20servidor%20web%20para%20generar%20un%20tablero%20en%20vivo%20en%20tiempo%20real%20basado%20en%20selecciones%20de%20jmp.%20Pens%C3%A9%20que%20podr%C3%ADa%20hacerlo%20con%20el%20controlador%20de%20estado%20de%20fila%2C%20pero%20es%20tan%20lento%20que%20mata%20la%20experiencia%20del%20usuario.%20Una%20vez%20que%20obtienes%20m%C3%A1s%20de%20500%20puntos%2C%20el%20rendimiento%20cae%20en%20picado.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELo%20que%20tengo%20ahora%20es%20hacer%20una%20selecci%C3%B3n%20en%20el%20gr%C3%A1fico%2C%20hacer%20clic%20en%20un%20bot%C3%B3n%20y%20luego%20se%20muestra%20el%20informe%20http.%3C%2FP%3E%3CP%3EQuiero%20deshacerme%20de%20ese%20clic%20de%20bot%C3%B3n.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEntonces%2C%20lo%20que%20estoy%20tratando%20de%20hacer%20ahora%20es%20enviar%20un%20lote%20de%20datos%20a%20mi%20servidor%20http%20para%20generar%20mi%20tablero.%20Al%20igual%20que%20un%20evento%20de%20javascript.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550868%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550868%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EPara%20los%20scripts%20m%C3%BAltiples%2C%20puede%20hacerlo%20todo%20en%20un%20solo%20script%20y%20usar%20un%20valor%20faltante%20en%20firstX%20para%20desactivarlo.%20Aqu%C3%AD%20hay%20un%20truco%20q%26amp%3Bd%20para%20agregar%20solo%20una%20copia%20de%20una%20segunda%20secuencia%20de%20comandos%2C%20o%20actualizar%20el%20gr%C3%A1fico%20si%20no%20se%20agrega%2C%20y%20a%C3%BAn%20usar%20su%20l%C3%B3gica%20para%20eliminarlo%20cuando%20haya%20terminado.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EMouseDown%20%3D%20Function(%20%7Bpx%2C%20py%7D%2C%20%0A%20%20%20%20Insert%20Into(%20lstX%2C%20pX%20)%3B%0A%20%20%20%20Insert%20Into(%20lstY%2C%20pY%20)%3B%0A%20%20%20%20firstX%20%3D%20lstX%5B1%5D%3B%0A%20%20%20%20lastX%20%3D%20lstX%5BN%20Items(%20lstX%20)%5D%3B%0A%20%20%20%20firstY%20%3D%20lstY%5B1%5D%3B%0A%20%20%20%20lastY%20%3D%20lstY%5BN%20Items(%20lstY%20)%5D%3B%20%0A%0A%2F%2F%20quick%20and%20dirty%20hack%20to%20only%20add%20the%20script%20once%0A%20%20%20%20If(%20N%20Items(%20((Report(%20MY_GRAPH_BUILDER%20)%5BFrameBox(%201%20)%5D)%20%26lt%3B%26lt%3B%20XPath(%20%22%2F%2FTopSeg%22%20))%20%26lt%3B%26lt%3B%20get%20script%20)%20%26lt%3B%202%2C%0A%20%20%20%20%20%20%20%20(Report(%20MY_GRAPH_BUILDER%20)%5BFrameBox(%201%20)%5D)%20%26lt%3B%26lt%3B%20Add%20Graphics%20Script(%0A%20%20%20%20%20%20%20%20%20%20%20%20Line%20Style(%20%22solid%22%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20Fill%20Color(%20%22BlueGreen%22%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20Transparency(%200.3%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20Rect(%20firstX%2C%20firstY%2C%20lastX%2C%20lastY%2C%201%20)%3B%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%2C%20%2F%2F%20ELSE%20make%20sure%20to%20redraw%20using%20new%20values%20(might%20work%20without%20this)%0A%20%20%20%20%20%20%20%20(Report(%20MY_GRAPH_BUILDER%20)%5BFrameBox(%201%20)%5D)%20%26lt%3B%26lt%3B%20inval%20%26lt%3B%26lt%3B%20updatewindow%3B%0A%20%20%20%20)%3B%0A)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550844%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550844%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Esimplificar%20el%3CEM%3E%20selecciona%20donde%3C%2FEM%3E%20expresi%C3%B3n%20tanto%20como%20sea%20posible.%20No%20veo%20el%20retraso%20para%20150%20filas%2C%20pero%20para%20100K%20filas%20es%20bastante%20malo.%20Esto%20me%20da%20una%20mejora%20de%2010X%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%0Ado_normal_select%20%3D%20Function(%20%7Bselect_range%7D%2C%0A%20%20%20%20%7Bstart%2C%20stop%2C%20sr1%2C%20sr2%2C%20sr3%2C%20sr4%7D%2C%20%0A%2F%2Fshow(%22normal_select%22)%3B%0A%0A%20%20%20%20start%20%3D%20HP%20Time()%3B%0A%0A%20%20%20%20sr1%20%3D%20select_range%5B1%5D%3B%0A%20%20%20%20sr2%20%3D%20select_range%5B2%5D%3B%0A%20%20%20%20sr3%20%3D%20select_range%5B3%5D%3B%0A%20%20%20%20sr4%20%3D%20select_range%5B4%5D%3B%0A%20%20%20%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%20sr1%20%26lt%3B%3D%20%3ASepal%20length%20%26lt%3B%3D%20sr2%20%26amp%3B%20sr3%20%26lt%3B%3D%20%3ASepal%20width%20%26lt%3B%3D%20sr4%20)%3B%0A%20%20%20%0A%2F%2F%20%20%20dt%20%26lt%3B%26lt%3B%20Select%20Where(%0A%2F%2F%20AsColumn(%3ASepal%20length)%20%26gt%3B%3D%20select_range%5B1%5D%20%0A%2F%2F%20%26amp%3B%20AsColumn(%3ASepal%20length)%20%26lt%3B%3D%20select_range%5B2%5D%0A%2F%2F%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26gt%3B%3D%20select_range%5B3%5D%20%0A%2F%2F%20%26amp%3B%20AsColumn(%3ASepal%20width)%20%26lt%3B%3D%20select_range%5B4%5D%0A%2F%2F%20)%3B%0A%20%0A%20%20%20%20stop%20%3D%20HP%20Time()%3B%0A%20%20%20%20Write(%20Eval%20Insert(%20%22%5C!nselect%20where%20%5Estop-start%5E%22%20)%20)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EHay%20tres%20cambios%3A%20eliminar%20AsColumn%2C%20sacar%20el%20sub%C3%ADndice%20del%20bucle%20impl%C3%ADcito%20y%20encadenar%20el%20operador%20de%20comparaci%C3%B3n.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1893%22%20target%3D%22_blank%22%3E%40Audrey_Shull%3C%2FA%3E%20-%20Desear%C3%ADa%20que%20el%20perfilador%20funcionara%20con%20esto.%20El%20generador%20de%20perfiles%20se%20detiene%20antes%20de%20que%20se%20abra%20la%20ventana%2C%20por%20lo%20que%20nunca%20puedo%20estudiar%20el%20tiempo%20dedicado%20a%20la%20selecci%C3%B3n%20interactiva.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550819%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550819%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%C2%BFQu%C3%A9%20est%C3%A1%20tratando%20de%20hacer%20arrastrando%20en%20el%20cuadro%20de%20marco%20Graph%20Builder%3F%20Si%20se%20trata%20de%20seleccionar%20filas%20y%20luego%20responder%2C%20un%20controlador%20de%20estado%20de%20fila%20asociado%20con%20la%20tabla%20de%20datos%20deber%C3%ADa%20ser%20suficiente.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550734%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550734%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEliminar%20impresiones%20deber%C3%ADa%20hacerlo%20m%C3%A1s%20r%C3%A1pido%2C%20ocultar%20la%20tabla%20de%20datos%20tambi%C3%A9n%20podr%C3%ADa%20ayudar%20un%20poco.%20Tambi%C3%A9n%20puede%20ayudar%20verificar%20que%20se%20haya%20realizado%20alg%C3%BAn%20cambio%20%22real%22%20entre%20dos%20eventos%2C%20pero%20dependiendo%20de%20la%20aplicaci%C3%B3n%20puede%20ser%20dif%C3%ADcil%20de%20verificar.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550675%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550675%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ES%C3%AD%2C%20siempre%20han%20sido%20dif%C3%ADciles%20de%20usar.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENecesito%20algo%20para%20obtener%20una%20respuesta%20en%20tiempo%20real%2C%20espero%20que%20el%20controlador%20de%20estado%20de%20fila%20est%C3%A9%20retrasado%20porque%20estaba%20tratando%20de%20escribir%20en%20la%20consola%20y%20que%20podr%C3%ADa%20ser%20m%C3%A1s%20r%C3%A1pido%20para%20otras%20tareas.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReescribir%20los%20criterios%20de%20selecci%C3%B3n%20funciona%20lo%20suficientemente%20bien%20para%20mi%20gr%C3%A1fico%20de%20dispersi%C3%B3n%2C%20aunque%20es%20un%20poco%20tonto%2C%20por%20otro%20lado%2C%20a%20mis%20histogramas%20de%20distribuci%C3%B3n%20no%20parece%20gustarles.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550669%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFHay%20alguna%20manera%20de%20hacer%20que%20el%20controlador%20de%20estado%20de%20fila%20sea%20menos%20lento%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550669%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ELos%20diferentes%20controladores%20de%20estado%20son%20un%20desastre%20en%20JMP%20y%2C%20en%20mi%20opini%C3%B3n%2C%20deben%20evitarse%20si%20es%20posible.%20He%20creado%20un%20elemento%20de%20la%20lista%20de%20deseos%20para%20que%20se%20mejoren.%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2FImprove-JMP-s-state-handlers-hover-label-row-state-handler%2Fm-p%2F527992%23U527992%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-idea-thread%20lia-fa-icon%20lia-fa-idea%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%20Mejore%20los%20controladores%20de%20estado%20de%20JMP%20(etiqueta%20flotante%2C%20controlador%20de%20estado%20de%20fila%2C%20controlador%20de%20estado%20de%20filtro%2C%20programador%2C%20...)%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
xxvvcczz
Level III

Is there a way to make the rowstate handler less laggy?

Is it possible to make the rowstate handler only fire on mouse up or after a selection event is completed? 

 

The realtime event causes drag select from my graph to lag and makes the user experience unpleasant.

 

I've gone so far  as to completely rewrite a selection event in the mousetrap thing but I'm having trouble applying it to histograms and I don't even love how it's performing either.

 

It would meet my needs if I could use the selection box the "Arrow(A)" tool at the same time as the mousetrap function so I could simply pick up my selected rows at the end of the moustrap event instead of firing off a million events while dragging the mouse along.

 

Stuff I don't like:
The longer you mouse down move the mouse around while selecting, more and more useless graphics scripts pile into the graph.

I'd like to just have one and only one. I added a loop at the end to kill them all out of the graph which is why they appear to "fade away".
I could just leave them there but they add visual noise to the graph and I don't know what happens when you get too many of them.

 

Edit: when you get too many of them they start to lag. It might be faster to destroy the graph and rebuild it than for looping to remove the left over graphics scripts. Edit 2: It's way faster to destroy the graph and recreate it but then the zoom gets reset, so I'll have to capture more about the state of the graph so I can rebuild it to hide the refresh from the user.

I got the Shift/control click stuff to work it just feels too hacky for production. Especially the control click it has this long lag time after you mouseup and the selection box chases the mouse even when you've already released the button, I think jmp is handling a bunch of stale drag events in the meantime before it stops moving.

 

Or just discard this whole adventure and find a way to have a row state handler that fires on mouse up (that would be ideal).

 

Examples I borrowed code from:
http://www.pega-analytics.co.uk/blog/segmented-regression/

https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/td...

 

 

Names Default To Here(1);

dt = open("$sample_data\Iris.jmp");
MY_GRAPH_BUILDER = Graph Builder(
	Size( 531, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :Sepal length ), Y( :Sepal width ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
		SendToReport(	
		Dispatch({},"Graph Builder",
			FrameBox,
			{Add Graphics Script(MouseTrap( MouseDown(x,y), MouseUp(x,y)))}
			),
			),
);





//MOUSE STUFF
get_box_dims = Function({firstX,lastX,firstY,lastY},
show("get_box_dims");
//show(firstX,lastX,firstY,lastY,modifier_key);

	If (lastX>firstX,
	max_x = lastX; min_x =firstX,
	max_x = firstX;min_x =lastX,
	);

	If (lastY>firstY,
	max_y = lastY; min_y =firstY,
	max_y = firstY;min_y =lastY,
	);


show(min_x,min_y,max_x,max_y);
evallist({min_x,max_x,min_y,max_y});
);

do_normal_select = Function({select_range},
show("normal_select");


dt << Select Where( 

	AsColumn(:Sepal length) >= select_range[1] 
	& AsColumn(:Sepal length) <= select_range[2]
	& AsColumn(:Sepal width) >= select_range[3] 
	& AsColumn(:Sepal width) <= select_range[4]
	
	);
);

do_shift_select = Function({select_range},
	show("shift_select");


	new_rows_to_add = as list(dt << Get Rows Where( 

		AsColumn(:Sepal length) >= select_range[1] 
		& AsColumn(:Sepal length) <= select_range[2]
		& AsColumn(:Sepal width) >= select_range[3] 
		& AsColumn(:Sepal width) <= select_range[4]
		
		)
			
	);

	if (length(new_rows_to_add) > 0,
	curr_rows = as list(dt << Get Selected Rows);
	rows_to_select = curr_rows || new_rows_to_add;
	dt << Select Rows( rows_to_select);
	);
		show(new_rows_to_add,length(new_rows_to_add));
);


do_ctrl_select = Function({select_range},
	show("ctrl_select");
	
	new_rows_to_subtract = associativearray(as list(dt << Get Rows Where( 

		AsColumn(:Sepal length) >= select_range[1] 
		& AsColumn(:Sepal length) <= select_range[2]
		& AsColumn(:Sepal width) >= select_range[3] 
		& AsColumn(:Sepal width) <= select_range[4]
		
		)
			
	));
	
	if (length(new_rows_to_subtract) > 0,
	curr_rows = associativearray(as list(dt << Get Selected Rows));
	show("current_rows_selected",length(curr_rows));
	show("number_rows_to_subtract",length(new_rows_to_subtract));
	intersection=curr_rows;intersection<<Intersect(new_rows_to_subtract);
	uncommon1 = curr_rows; 
	uncommon1<<remove(intersection);
	uncommon1 = uncommon1<<getkeys;

	show(uncommon1);
	show("uncommon array length",length(uncommon1));
	
	uncommon2 = new_rows_to_subtract; 
	uncommon2<<remove(intersection);
	uncommon2 = uncommon2<<getkeys;
	
	new_rows_to_add = as list(uncommon1 || uncommon2);
	
	
	dt << Clear Select;
	dt << Select Rows(new_rows_to_add);
	);

);




lstX = {};
lstY = {};

xpr_select_box = Expr(
	Line Style( "solid" );
	Fill Color( "BlueGreen" );
	Transparency( 0.03 );
	Rect(firstX, firstY, lastX, lastY, 1);
);

 
MouseDown = Function({px,py},


Insert Into(lstX,pX);
Insert Into(lstY,pY);
firstX = lstX[1];
lastX = lstX[NItems(lstX)];	
firstY = lstY[1];
lastY = lstY[NItems(lstY)];	


//show what's being selected
(report(MY_GRAPH_BUILDER)[FrameBox(1)]) << Add Graphics Script(
	Line Style( "solid" );
	Fill Color( "BlueGreen" );
	Transparency( 0.03 );
	Rect(firstX, firstY, lastX, lastY, 1);
);


);

MouseUp = Function({px,py},
		box_dims = get_box_dims(firstX,lastX,firstY,lastY);
		show("mouseUP range",box_dims);
		
		If( Is Shift Key(),
			modifier_key = "shift";do_shift_select(box_dims);,
			Is Control Key(),
			modifier_key = "control";do_ctrl_select(box_dims);,
		//no modifier key
		modifier_key = "none";dt << Clear Select;do_normal_select(box_dims);
		);
		


// I have no idea how this Xpath works but its pretty sweet
	script_list = ((report(MY_GRAPH_BUILDER)[FrameBox(1)]) << XPath("//TopSeg")) << get script;
	for(i=0,i<=length(script_list),i++,
	(report(MY_GRAPH_BUILDER)[FrameBox(1)]) << Remove Graphics Script( 2 );	
	);
	

		lstX = {};
		lstY = {};
		modifier_key = "none";	
);

 

11 REPLIES 11
xxvvcczz
Level III

Re: Is there a way to make the rowstate handler less laggy?

This made a big improvement. Thanks!

Craige_Hales
Super User

Re: Is there a way to make the rowstate handler less laggy?

For the multiple scripts, you could do it all in a single script and use a missing value in firstX to turn it off. Here's a q&d hack to only add one copy of a second script, or freshen the graph if not adding, and still use your logic to remove it when done.

 

MouseDown = Function( {px, py}, 
    Insert Into( lstX, pX );
    Insert Into( lstY, pY );
    firstX = lstX[1];
    lastX = lstX[N Items( lstX )];
    firstY = lstY[1];
    lastY = lstY[N Items( lstY )];	

// quick and dirty hack to only add the script once
    If( N Items( ((Report( MY_GRAPH_BUILDER )[FrameBox( 1 )]) << XPath( "//TopSeg" )) << get script ) < 2,
        (Report( MY_GRAPH_BUILDER )[FrameBox( 1 )]) << Add Graphics Script(
            Line Style( "solid" );
            Fill Color( "BlueGreen" );
            Transparency( 0.3 );
            Rect( firstX, firstY, lastX, lastY, 1 );
        );
    , // ELSE make sure to redraw using new values (might work without this)
        (Report( MY_GRAPH_BUILDER )[FrameBox( 1 )]) << inval << updatewindow;
    );
);
Craige

Recommended Articles