Skip to content

Commit

Permalink
Use dataiku regular font for plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienDaou committed Nov 29, 2024
1 parent b1f33e8 commit 007d847
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 78 deletions.
7 changes: 5 additions & 2 deletions dash_tabulator/assets/tabulator_dataiku.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* define SourceSansPro */
@font-face {
src: url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,500,600');
font-family: 'dataiku';
src: url('/static/fonts/SourceSansPro-Regular.woff');
font-weight: 400;
}

body {
Expand All @@ -9,7 +11,8 @@ body {
}

body, button, select.tabulator-page-size, input[type=search] {
font-family: 'Source Sans Pro' !important;
font-family: 'dataiku' !important;
font-size: 13px;
}

.tabulator {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

75 changes: 1 addition & 74 deletions dss-plugin-visual-edit/python-lib/dash_tabulator/metadata.json
Original file line number Diff line number Diff line change
@@ -1,74 +1 @@
{
"src/lib/components/DashTabulator.react.js": {
"description": "",
"displayName": "DashTabulator",
"methods": [],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "ID used to identify this component in Dash callbacks."
},
"data": {
"type": {
"name": "array"
},
"required": false,
"description": "Data to display in the table.",
"defaultValue": {
"value": "[]",
"computed": false
}
},
"columns": {
"type": {
"name": "array"
},
"required": false,
"description": "Column definitions.",
"defaultValue": {
"value": "[]",
"computed": false
}
},
"datasetName": {
"type": {
"name": "string"
},
"required": false,
"description": "Name of the corresponding Dataiku dataset.",
"defaultValue": {
"value": "\"\"",
"computed": false
}
},
"groupBy": {
"type": {
"name": "array"
},
"required": false,
"description": "Columns to group by.",
"defaultValue": {
"value": "[]",
"computed": false
}
},
"setProps": {
"type": {
"name": "func"
},
"required": false,
"description": "Dash-assigned callback that should be called to report property changes\nto Dash, to make them available for callbacks."
},
"cellEdited": {
"type": {
"name": "object"
},
"required": false,
"description": "cellEdited captures the cell that was clicked on"
}
}
}
}
{"src/lib/components/DashTabulator.react.js":{"description":"","displayName":"DashTabulator","methods":[],"props":{"id":{"type":{"name":"string"},"required":false,"description":"ID used to identify this component in Dash callbacks."},"data":{"type":{"name":"array"},"required":false,"description":"Data to display in the table.","defaultValue":{"value":"[]","computed":false}},"columns":{"type":{"name":"array"},"required":false,"description":"Column definitions.","defaultValue":{"value":"[]","computed":false}},"datasetName":{"type":{"name":"string"},"required":false,"description":"Name of the corresponding Dataiku dataset.","defaultValue":{"value":"\"\"","computed":false}},"groupBy":{"type":{"name":"array"},"required":false,"description":"Columns to group by.","defaultValue":{"value":"[]","computed":false}},"setProps":{"type":{"name":"func"},"required":false,"description":"Dash-assigned callback that should be called to report property changes\nto Dash, to make them available for callbacks."},"cellEdited":{"type":{"name":"object"},"required":false,"description":"cellEdited captures the cell that was clicked on"}}}}
Binary file not shown.
13 changes: 12 additions & 1 deletion dss-plugin-visual-edit/webapps/visual-edit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 3. Define Dash webapp layout and components.
from __future__ import annotations
import logging
import os
from webapp.config.models import LinkedRecord
import webapp.logging.setup # noqa: F401 necessary to setup logging basicconfig before dataiku module sets a default config
from datetime import datetime
Expand All @@ -24,7 +25,7 @@
EditUnauthorized,
DataEditor,
)
from flask import Flask, jsonify, make_response, request
from flask import Flask, jsonify, make_response, request, send_from_directory
from tabulator_utils import get_columns_tabulator, get_values_from_df

from webapp.config.loader import WebAppConfig
Expand Down Expand Up @@ -492,4 +493,14 @@ def lookup_endpoint(linked_ds_name):
return jsonify(editor_values_param)


FONTS_FOLDER = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", "fonts"
)


@server.route("/static/fonts/<path:filename>", methods=["GET"])
def serve_fonts(filename):
return send_from_directory(FONTS_FOLDER, filename)


logging.info("Webapp OK")

0 comments on commit 007d847

Please sign in to comment.