3
71td                 @   s  d dl m Z  d dlmZ d dlZd dlmZ d dlmZmZm	Z	 d dlm
Z
 d dlmZ d dlZd dlZdZejejd	j Zeej  e Zej Zejejd
dd ej D ejddddddddiddddddd dBD dd dCD  d d dDD  d%d dED  d(ejd)ejd*d+d,ejd-d.d/d0gdd1d2ejd3d4gd5d6id7Ze jed8d9ed
d:gd;d< Z e jed)d=ed*d9ged
d>ed-d?ge	d)d=gd@dA Z!dS )F    )app)
dash_tableN)	datastore)InputOutputState)dcc)htmlz1assets/XJETS-master - col_name_attributes_new.csv	attributetablec             C   s    g | ]}t | d  |ddqS )pretty_nameT)nameidZ
selectable)
cl_attr_df).0i r   -/var/www/atlasX/components/tabs/data_table.py
<listcomp>   s   r   recordsFnativesingle   Z	overflowXautohiddenZellipsisnormal)ZoverflowZtextOverflowheightzwhite-spacec             C   s   g | ]}d |iddddqS )	column_idleftZ100px)if	textAlignz	min-widthmaxWidthr   )r   cr   r   r   r   5   s   NameclassX-Ray featuresc             C   s   g | ]}d |iddddqS )r   rightZ50px)r   r    z	min-widthr!   r   )r   r"   r   r   r   r   ;   s   z2angular_scale2bapp3c             C   s   g | ]}d |iddddqS )r   r&   Z70px)r   r    z	min-widthr!   r   )r   r"   r   r   r   r   A   s   ra2dec2IAU name	distance2c             C   s   g | ]}d |iddddqS )r   r&   Z80px)r   r    z	min-widthr!   r   )r   r"   r   r   r   r   G   s   	Core L1.4	Lobe L300)r   columnsdatacolumn_selectablesort_actionrow_selectable	page_sizefilter_actionstyle_table
style_cellstyle_cell_conditionalzclick-info-dialog_dtzmain-info-content_dtzmax-width scroll max-height-500)r   	classNamezclose-diag_dtClosezclose-button)r   childrenr:   z	max-width)r   r<   openr:   ztable-filter-container)r   positioninitial)styleztatable-filter-containerbler<   r1   c             C   s    | d krt }n
tj| }tj S )N)dfpd	DataFramer	   Div)rowsZdffr   r   r   dummy_table_filter_callback^   s    
rF   r=   selected_rowsn_clicksc             C   sP  dg i}|r|rdS t |d dks0t | dko4| rLtj }d}d}t | dkrx|j| d  d }|j| d  d }t |d dkr|d d d }||d |k jd d }tjdj|}|rDttj| tj|d	d
tj	tj
tjdj|ddgdd
tj	tj|gdd
tjddd
tj	tj|gdd
tj g}d|fS d S )NpointsF r   radio_over_xrayr#   textz#No information is available for {0}ztitle-dialog)r:   z&data_downloads/{0}/radio_over_xray.pngi  )srcwidthz
img-dialogztable-dialog
Referenceszfloat-left margin-10pxz-float-left clear-both larger-font margin-10pxT)FrJ   )lendsget_filtered_datailocr	   H3formatprintget_formatted_refsrD   Imgr   get_asset_urlget_source_tableH5Br)selectedRows
closeClickdiagOpen	clickDatarA   sourcerK   childr   r   r   display_info_dialogj   s:    $

rc   )r#   r$   r%   )r'   r(   r)   )r*   r+   r,   r-   )r.   r/   )"r   dashr   pandasrB   r   dash.dependenciesr   r   r   r   r	   jsonsd_material_uismuicol_attrread_csv	set_indexto_dictr   rV   keysrQ   get_master_datarA   rD   	DataTableget_orig_columnsDialogButtonlayoutcallbackrF   rc   r   r   r   r   <module>   s^   
(


