You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have problems to "create" slices... I am using Debian GNU/Linux, I follow this steps:
Creating develop environment:
cd /opt
git clone https://github.com/airbnb/caravel.git
cd /opt/caravel
python setup.py develop
fabmanager create-admin --app caravel
cd /opt/caravel/caravel/bin
./caravel db upgrade
./caravel init
./caravel load_examples
cd /opt/caravel/caravel/assets
npm install
npm run prod
I made a lot of test but I follow this steps to add a slice:
cd /opt/caravel/caravel
vim viz.py
I copied big_number_total example and renamed to gauge:
class GaugeViz(BaseViz):
"""Put emphasis on a single metric with this big number viz"""
viz_type = "gauge"
verbose_name = _("Gauge")
credits = 'a <a href="https://github.com/airbnb/caravel">Caravel</a> original'
is_timeseries = False
fieldsets = ({
'label': None,
'fields': (
'metric',
'subheader',
'y_axis_format',
)
},)
form_overrides = {
'y_axis_format': {
'label': _('Number format'),
}
}
def reassignments(self):
metric = self.form_data.get('metric')
if not metric:
self.form_data['metric'] = self.orig_form_data.get('metrics')
def query_obj(self):
d = super(GaugeViz, self).query_obj()
metric = self.form_data.get('metric')
if not metric:
raise Exception("Pick a metric!")
d['metrics'] = [self.form_data.get('metric')]
self.form_data['metric'] = metric
return d
def get_data(self):
form_data = self.form_data
df = self.get_df()
df.sort_values(by=df.columns[0], inplace=True)
return {
'data': df.values.tolist(),
'subheader': form_data.get('subheader', ''),
}
After:
cd /opt/caravel/caravel/assets/javascripts/modules
vim caravel.js
Hello:
I have problems to "create" slices... I am using Debian GNU/Linux, I follow this steps:
Creating develop environment:
I made a lot of test but I follow this steps to add a slice:
I copied big_number_total example and renamed to gauge:
After:
I add a gauge.js:
After:
I modified the line:
Finally I compiled again with npm and start server:
But still without see the Gauge slice.
The text was updated successfully, but these errors were encountered: