import dash 
from dash.dependencies import ALL, MATCH
from dash.exceptions import PreventUpdate
from dash.dependencies import Input, State, Output
from map_handler import DEBUG, FREQ
from map_handler import cache, cache_timeout

@dash.callback(
             Output({'type':'caret', 'index': MATCH}, 'style'),
             [Input({'type':'collapse', 'index': MATCH}, 'is_open')],
)
def rotate_section_caret(collapse_open):
    """ Rotates section 3 menu caret """
    rotation = 0 if collapse_open else 180
    rotate_caret = {
      'transform': 'rotate({}deg)'.format(rotation),
      '-ms-transform': 'rotate({}deg)'.format(rotation),
      '-webkit-transform': 'rotate({}deg)'.format(rotation)
    }
    return rotate_caret
