extend common transitive styles for stylized map view
180857
function mergeTransitiveStyles (base, extended) {
  const styles = Object.assign({}, base)
  for (const key in extended) {
    if (key in base) styles[key] = Object.assign({}, styles[key], extended[key])
    else styles[key] = extended[key]
  }
  return styles
}
1025295
def _get_cartocss(self, basemap, has_time=False):
        """"""
        if isinstance(self.size, (int, float)):
            size_style = self.size
        elif isinstance(self.size, dict):
            self.size['range'] = (
                [1, 5] if self.size['range'] == [5, 25]
                else self.size['range']
            )
            size_style = ('ramp([{column}],'
                          ' range({min_range},{max_range}),'
                          ' {bin_method}({bins}))').format(
                              column=self.size['column'],
                              min_range=self.size['range'][0],
                              max_range=self.size['range'][1],
                              bin_method=self.size['bin_method'],
                              bins=self.size['bins'])

        if self.scheme:
            color_style = get_scheme_cartocss(
                'value' if has_time else self.color,
                self.scheme)
        else:
            color_style = self.color

        line_color = '#000' if basemap.source == 'dark' else '#FFF'
        if self.time:
            css = cssify({
                # Torque Point CSS
                "#layer": {
                    'marker-width': size_style,
                    'marker-fill': color_style,
                    'marker-fill-opacity': self.opacity,
                    'marker-allow-overlap': 'true',
                    'marker-line-width': 0,
                    'marker-line-color': line_color,
                    'marker-line-opacity': 1,
                    'comp-op': 'source-over',
                }
            })
            if self.color in self.style_cols:
                css += cssify({
                    '#layer[{} = null]'.format(self.color): {
                        'marker-fill': '#666'}
                    })
            for trail_num in range(1, self.time['trails'] + 1):
                # Trails decay as 1/2^n, and grow 30% at each step
                trail_temp = cssify({
                    '#layer[frame-offset={}]'.format(trail_num): {
                        'marker-width': size_style * (1.0 + trail_num * 0.3),
                        'marker-opacity': 0.9 / 2.0**trail_num,
                    }
                })
                css += trail_temp
            return css
        else:
            if self.geom_type == 'point':
                css = cssify({
                    # Point CSS
                    "#layer": {
                        'marker-width': size_style,
                        'marker-fill': color_style,
                        'marker-fill-opacity': self.opacity,
                        'marker-allow-overlap': 'true',
                        'marker-line-width': '0.5',
                        'marker-line-color': line_color,
                        'marker-line-opacity': '1',
                    }})
                if self.color in self.style_cols:
                    css += cssify({
                        '#layer[{} = null]'.format(self.color): {
                            'marker-fill': '#ccc'}
                        })
                return css
            if self.geom_type == 'line':
                css = cssify({
                    "#layer": {
                        'line-width': size_style,
                        'line-color': color_style,
                        'line-opacity': self.opacity
                    }})
                if self.color in self.style_cols:
                    css += cssify({
                        '#layer[{} = null]'.format(self.color): {
                            'line-color': '#ccc'}
                        })
                return css
            if self.geom_type == 'polygon':
                css = cssify({
                    "#layer": {
                        'polygon-fill': color_style,
                        'polygon-opacity': self.opacity,
                        'polygon-gamma': '0.5',
                        'line-color': '#FFF',
                        'line-width': '0.5',
                        'line-opacity': '0.25',
                        'line-comp-op': 'hard-light',
                    }})
                if self.color in self.style_cols:
                    css += cssify({
                        '#layer[{} = null]'.format(self.color): {
                            'polygon-fill': '#ccc'}
                        })
                return css
            else:
                raise ValueError('Unsupported geometry type: {}'.format(
                    self.geom_type))
299745
function FCFlowView() {
        FCGeneralEdgeView.apply(this, arguments);
        this.lineStyle = PreferenceManager.get("flowchart.flow.lineStyle", Core.LS_ROUNDRECT) || PreferenceManager.get("view.lineStyle", Core.LS_OBLIQUE);
    }
446752
private void appendStyleMap(final XMLUtil util, final Appendable appendable) throws IOException {
        appendable.append("<style:map");
        util.appendEAttribute(appendable, "style:condition", "value()>=0");
        util.appendEAttribute(appendable, "style:apply-style-name", this.dataStyle.getName());
        appendable.append("/>");
    }
836328
function getNewDefaultRenderer(map) {
        switch (map.orientation) {
            case "orthogonal":
                return new me.TMXOrthogonalRenderer(map);

            case "isometric":
                return new me.TMXIsometricRenderer(map);

            case "hexagonal":
                return new me.TMXHexagonalRenderer(map);

            case "staggered":
                return new me.TMXStaggeredRenderer(map);

            // if none found, throw an exception
            default:
                throw new Error(map.orientation + " type TMX Tile Map not supported!");
        }
    }
145227
function() {
        var style = this._div.style,
            view = this._viewportRect();

        var scale = view._scale;
        var dx = -view._x * scale;
        var dy = -view._y * scale;

        style.transform = style[Crafty.support.prefix + "Transform"] =
            "scale(" + scale + ", " + scale + ")";
        style.left = Math.round(dx) + "px";
        style.top = Math.round(dy) + "px";
        style.zIndex = this.options.z;
    }
1029114
def decorate(*reversed_views):
    
    fns = reversed_views[::-1]
    view = fns[0]
    for wrapper in fns[1:]:
        view = wrapper(view)
    return view
1275425
function marginAndPaddingStyles(scale) {
  const styles = {};

  shorthands.forEach(([propShorthand, prop]) => {
    directions.forEach(([directionShorthand, direction]) => {
      scale.forEach((unit, idx) => {
        styles[`${propShorthand}${directionShorthand}${idx}`] = {
          [`${prop}${direction}`]: unit,
        };
      });
    });
  });

  return styles;
}
464790
function css(key, val) {
  var style, props;
  if(!this.length) {
    return this;
  }

  if(key && typeof key === 'object') {
    props = key;
  }else if(key && val) {
    props = {};
    props[key] = val;
  }

  // get style object
  if(key === undefined) {
    style = window.getComputedStyle(this.dom[0], null);
    // TODO: convert to plain object map?
    // for the moment return CSSStyleDeclaration
    return style;
  // get single style property value
  }else if(typeof key === 'string' && !val) {
    style = window.getComputedStyle(this.dom[0], null);
    return style.getPropertyValue(key);
  }

  // set inline styles
  this.each(function(el) {
    el.style = el.style;
    for(var z in props) {
      el.style[z] = '' + props[z];
    }
  });
  return this;
}
877127
function(map) {
        var tileQueue = this.tileQueue[map.id];
        var limit = this.tilesPerFrame;
        var animating = map.zoomTween && map.zoomTween.playing;
        while (!animating && tileQueue.length && limit) {
            tileQueue.shift().draw(true);
            --limit;
        }
    }
275911
function buildStyleAttribute(styleMap) {
  var styleAttribute = [];
  for (var property in styleMap) {
    styleAttribute.push(property + ': ' + styleMap[property] + ';');
  }
  return styleAttribute.join(' ');
}
175088
def split_styles(mark):
    
    
    markers = [mark._table[key] for key in mark._marker][0]
    nstyles = []
    for m in markers:
        ## fill and stroke are already rgb() since already in markers
        msty = toyplot.style.combine({
            "fill": m.mstyle['fill'],
            "stroke": m.mstyle['stroke'],
            "opacity": m.mstyle["fill-opacity"],
        }, m.mstyle)
        msty = _color_fixup(msty)
        nstyles.append(msty)
    
    ## uses 'marker.size' so we need to loop over it
    lstyles = []
    for m in markers:
        lsty = toyplot.style.combine({
        "font-family": "Helvetica",
        "-toyplot-vertical-align": "middle",
        "fill": toyplot.color.black,
        "font-size": "%rpx" % (m.size * 0.75),
        "stroke": "none",
        "text-anchor": "middle",
        }, m.lstyle)
        ## update fonts
        fonts = toyplot.font.ReportlabLibrary()
        layout = toyplot.text.layout(m.label, lsty, fonts)
        lsty = _color_fixup(layout.style)
        lstyles.append(lsty)
    
    nallkeys = set(itertools.chain(*[i.keys() for i in nstyles]))
    lallkeys = set(itertools.chain(*[i.keys() for i in lstyles]))
    nuniquekeys = []
    nsharedkeys = []
    for key in nallkeys:
        vals = [nstyles[i].get(key) for i in range(len(nstyles))]
        if len(set(vals)) > 1:
            nuniquekeys.append(key)
        else:
            nsharedkeys.append(key)
    luniquekeys = []
    lsharedkeys = []
    for key in lallkeys:
        vals = [lstyles[i].get(key) for i in range(len(lstyles))]
        if len(set(vals)) > 1:
            luniquekeys.append(key)
        else:
            lsharedkeys.append(key)

    ## keys shared between mark and text markers
    repeated = set(lsharedkeys).intersection(set(nsharedkeys))
    for repeat in repeated:
        ## if same then keep only one copy of it
        lidx = lsharedkeys.index(repeat)
        nidx = nsharedkeys.index(repeat)
        if lsharedkeys[lidx] == nsharedkeys[nidx]:
            lsharedkeys.remove(repeat)
        else:
            lsharedkeys.remove(repeat)
            luniquekeys.append(repeat)
            nsharedkeys.remove(repeat)
            nuniquekeys.append(repeat)
            
    ## check node values
    natt = ["%s:%s" % (key, nstyles[0][key]) for key in sorted(nsharedkeys)]
    latt = ["%s:%s" % (key, lstyles[0][key]) for key in sorted(lsharedkeys)]
    shared_styles = ";".join(natt+latt)
    unique_styles = {
        "node": [{k:v for k,v in nstyles[idx].items() if k in nuniquekeys} for idx in range(len(markers))],
        "text": [{k:v for k,v in lstyles[idx].items() if k in luniquekeys} for idx in range(len(markers))]
    }
    
    return shared_styles, unique_styles
825042
function getLayout(collection, name) {
  if (!name) return;
  if (collection instanceof Map) {
    for (const [key, view] of collection) {
      if (name === key) {
        return view;
      }
      if (!view.path) continue;
      if (!view.hasPath) {
        return getView(collection, name);
      }
      if (view.hasPath(name)) {
        return view;
      }
    }
    return;
  }

  for (const key of Object.keys(collection)) {
    const view = collection[key];
    if (name === key) {
      return view;
    }
    if (!view.path) continue;
    if (!view.hasPath) {
      return getView(collection, name);
    }
    if (view.hasPath(name)) {
      return view;
    }
  }
}
1238520
private void renderHorizontal(Graphic g, int ty, double viewY)
    {
        final int inTileWidth = (int) Math.ceil(viewer.getWidth() / (double) map.getTileWidth());
        final int sx = (int) Math.floor((viewer.getX() + viewer.getViewX()) / map.getTileWidth());
        final double viewX = viewer.getX();

        for (int h = 0; h <= inTileWidth; h++)
        {
            final int tx = h + sx;
            if (!(tx < 0 || tx >= map.getInTileWidth()))
            {
                renderTile(g, tx, ty, viewX, viewY);
            }
        }
    }
997319
function() {
        var style = this._element.style,
            coord = this.__coord || [0, 0, 0, 0],
            co = {
                x: coord[0],
                y: coord[1],
                w: coord[2],
                h: coord[3]
            },
            prefix = Crafty.support.prefix,
            trans = [];

        if (this._cssStyles.visibility !== this._visible) {
            this._cssStyles.visibility = this._visible;
            if (!this._visible) {
                style.visibility = "hidden";
            } else {
                style.visibility = "visible";
            }
        }

        //utilize CSS3 if supported
        if (Crafty.support.css3dtransform && !this.avoidCss3dTransforms) {
            trans.push(
                "translate3d(" + ~~this._x + "px," + ~~this._y + "px,0)"
            );
        } else {
            if (this._cssStyles.left !== this._x) {
                this._cssStyles.left = this._x;
                style.left = ~~this._x + "px";
            }
            if (this._cssStyles.top !== this._y) {
                this._cssStyles.top = this._y;
                style.top = ~~this._y + "px";
            }
        }

        if (this._cssStyles.width !== this._w) {
            this._cssStyles.width = this._w;
            style.width = ~~this._w + "px";
        }
        if (this._cssStyles.height !== this._h) {
            this._cssStyles.height = this._h;
            style.height = ~~this._h + "px";
        }
        if (this._cssStyles.zIndex !== this._z) {
            this._cssStyles.zIndex = this._z;
            style.zIndex = this._z;
        }

        if (this._cssStyles.opacity !== this._alpha) {
            this._cssStyles.opacity = this._alpha;
            style.opacity = this._alpha;
            style[prefix + "Opacity"] = this._alpha;
        }

        if (this._mbr) {
            var origin = this._origin.x + "px " + this._origin.y + "px";
            style.transformOrigin = origin;
            style[prefix + "TransformOrigin"] = origin;
            if (Crafty.support.css3dtransform)
                trans.push("rotateZ(" + this._rotation + "deg)");
            else trans.push("rotate(" + this._rotation + "deg)");
        }

        if (this._flipX) {
            trans.push("scaleX(-1)");
        }

        if (this._flipY) {
            trans.push("scaleY(-1)");
        }

        if (this._cssStyles.transform !== trans.join(" ")) {
            this._cssStyles.transform = trans.join(" ");
            style.transform = this._cssStyles.transform;
            style[prefix + "Transform"] = this._cssStyles.transform;
        }

        this.trigger("Draw", {
            style: style,
            type: "DOM",
            co: co
        });

        return this;
    }
681977
def style(self):
        """"""
        style = mapnik.Style()
        rule = mapnik.Rule()
        self._symbolizer = self.symbolizer()
        rule.symbols.append(self._symbolizer)
        style.rules.append(rule)
        return style
1057879
function(context, geometry, style, featureId, type) {
        var components = geometry.components;
        var len = components.length;
        context.beginPath();
        var start = this.getLocalXY(components[0]);
        var x = start[0];
        var y = start[1];
        if (!isNaN(x) && !isNaN(y)) {
            context.moveTo(start[0], start[1]);
            for (var i=1; i<len; ++i) {
                var pt = this.getLocalXY(components[i]);
                context.lineTo(pt[0], pt[1]);
            }
            if (type === "fill") {
                context.fill();
            } else {
                context.stroke();
            }
        }
    }