Inserting signal into Vega data with `trigger`, being flat mapped - vega

I was trying to store a brush interaction (signal) into a data via a trigger. However, the tuple seems to be flattened---I was expecting it to be [[brush_start, brush_end], [brush_start, brush_end],...], but now it's just [brush_start, brush_end, brush_start, brush_end...]].
Open the Chart in the Vega Editor.
Is there a way I should manipulate the signal before I insert it?
Thanks!

This can be done by creating another signal. I have updated the spec

Related

Script to launch interactive session inside Spss Modeler

i want do interactive tree for my project. i'm writing code inside modeler syntax and this program to get me what i want(which i want Rots tree values) . Launch interactive session opens the tree builder, values is okey but i dont generated model inside scripting. i need just a click generated model icon (without manual) but this way manuel click. who know is this trick with coding or scripting?
i'm writing my code example;
import modeler.api
stream = modeler.script.stream()
res=[]
m1= stream.findByID('id68YV8NTPKIR')
m1.setPropertyValue("prune_tree", False)
m1.setPropertyValue("model_output_type", "InteractiveBuilder")
m1.setPropertyValue("tree_directives", """Grow Node Index 0 Children 1 2 Spliton (
"TotalCharges", Interval ( NegativeInfinity, 100) Interval ( 100, Infinity ))""")
m1.setPropertyValue("tree_directives", "Test")
m1.setPropertyValue("model_name", "Cart_Drug")
m1.run(res)
thanks.
There is no way to automate the generation of the model from an interactive session as these are by design intended to be interactive.
Can you provide some insight into why you are looking to automate an interactive session rather than just using the default of generating a model directly? Is there some specific feature that you are looking for that is not otherwise available?

How to convert the spectrum type ("Spectrum" -> "Convert Data to")

Is there a manner in which one can convert the spectrum type, for instance to EELS, by DM scripting? This screenshot represents what I'm referring to. I'd like to import a dataset using the GMS 3.4 Python interface, and then turn that into a EELS dataset for further processing (ideally without having to manually interface with the screenshotted menu bar).
Yes there is.
The "type" is simply a meta-data tag
which you can easily set with the TagGroup commands.
There is, however, one complication:
Data "registers" itself with DM when it first appears. Changing the meta-tags manually doesn't change this registration. (The menu command, however, does.)
Thus, you will only see effect of the type change when
either:
You save, close and reopen the data
You clone the data, throw away the original, and display the clone
The second option might cause issues with data-linkage though, as the unique image ID of the data is newly created.
Example using the first method (requires save & load):
image img:=GetFrontImage()
TagGroup tg = img.ImageGetTagGroup()
tg.TagGroupSetTagAsString("Meta Data:Signal","EELS")
imageDocument doc = img.ImageGetOrCreateImageDocument()
doc.ImageDocumentSave(0)
string path = doc.ImageDocumentGetCurrentFile()
doc.ImageDocumentClose(0)
doc = NewImageDocumentFromFile(path)
doc.ImageDocumentShow()
An alternative option is to rely on the menu command. If it is present, then you can simply use the ChoseMenuItem() command to invoke it.
However, the command will only be available with the UI when the data you want to change is front-most (i.e. not a script window!) You will need to ensure by script, that this is the case. A simple ShowWindow() will do.
image img:=GetFrontImage()
img.ShowImage()
if ( !ChooseMenuItem("Spectrum","Convert Data To","None") )
Throw( "Conversion to none failed.")
if ( !ChooseMenuItem("Spectrum","Convert Data To","EDS") )
Throw( "Conversion to none failed.")
Disadvantage of this solution: You will get the user-prompts.

What jquery tables support table cell tooltips?

i need to display tooltips for my table cells. Are there any plugins for that purposes?
Thanks in advance!
You should be able to use any table and tooltip plugins you want - you just need to trigger the tooltips correctly depending on how you are initializing and updating the table.
For example, if you use jQuery DataTables (which I assume you are looking at given the tag you gave your question) with the jQuery UI tooltip widget you could simply initialize the tooltips once you've initialized the table. If you have the tooltip data already in the table, it could be as simple as:
$('#mytable').dataTable().tooltip();
If you have a more complex table that gets updated (such as using deferred rendering for a giant dataset), then you'd probably need to tie into the row creation callback to get the tooltips on any new rows by doing something like this in the init options:
"fnCreatedRow": function (nRow, aData, iDataIndex) {
$('.tooltip', nRow).tooltip()
}

How to trigger the ALV DATA_CHANGE event manually?

I have an instance of CL_GUI_ALV_GRID referenced by variable mo_alv_grid.
I have a button column in this grid, which after some logic, updates the table mt_alv_grid (backing mo_alv_grid).
I need to be able to trigger the event DATA_CHANGED at this point.
I have tried many methods of CL_GUI_ALV_GRID, like CHECK_DATA_CHANGED and REFRESH_TABLE_DISPLAY
and even CL_GUI_CFW=>FLUSH and CL_GUI_CFW=>SET_NEW_OK_CODE( 'ENTER' ). but none of this has worked.
Is there a way to trigger the DATA_CHANGED event, or should I be doing things completely differently ?
I don't know if this solves your problem, but in order to update the ALV internal table in the PAI, you could use the following method:
DATA lv_entries_are_consisted TYPE abap_bool.
mo_grid->check_changed_data(
IMPORTING
e_valid = lv_entries_are_consisted
).
well, it's possible.
1) don't change values in internal table by program
2) create a change protocol of type LVC_T_MODI with a new values for lines needed
then call
CALL METHOD lo_grid->change_data_from_inside
EXPORTING
it_style_cells = lt_cells.
where lo_grid is instance of cl_gui_alv_grid and lt_cells table type LVC_T_MODI. please note, that you will need to set field VAL_DATA of layout structure (LVC_S_LAYO) to 'X' when calling ALV grid for the first time to make this work.
after this, class will automatically change internal table for you and call DATA_CHANGE event

update table in gtk

I have window that contains a table on screen, now I want to attach a widget to that table I use
gtk_table_attach(GTK_TABLE(table), label, ...)
the function is correct and it runs without any error
but table does not respond to that line I mean there is no change on my table, I think I need something to tell that table update it self but how?
note= that line is inside a callback of a signal and I am sure that signal runs
note2= I do not want to destroy window for that
note3= I use gtk+ and pygtk
note4= I am sure I attach that widget to a correct position ( it is free)
Did you call gtk_widget_show() on label first?