This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################### | |
# | |
## @file postgres.py | |
# | |
########################################################################### | |
import psycopg2 | |
########################################################################### | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from psycopg2.extras import DictCursor | |
from psycopg2.pool import SimpleConnectionPool | |
class Database: | |
__pool = None | |
@classmethod | |
def initialize(cls, **kwargs): | |
cls.__pool = SimpleConnectionPool(minconn=2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const svgChartDom = document.getElementById("svg-element"); | |
const svgSize = svgChartDom.getBoundingClientRect(); | |
const svgChart = new XMLSerializer().serializeToString(svgChartDom); | |
let canvas = document.createElement("canvas"); | |
canvas.width = svgSize.width; | |
canvas.height = svgSize.height; | |
let ctx = canvas.getContext("2d"); | |
// Use canvg package to create canvas, resolve the limitation of IE, where drawing SVG would taint the canvas | |
let v = Canvg.fromString(ctx!, svgChart); | |
v.start(); |