Update map template variables specific to a clustered circle visual
174809
def add_unique_template_variables(self, options):
        """"""
        options.update(dict(
            colorStops=self.color_stops,
            colorDefault=self.color_default,
            radiusStops=self.radius_stops,
            clusterRadius=self.clusterRadius,
            clusterMaxZoom=self.clusterMaxZoom,
            strokeWidth=self.stroke_width,
            strokeColor=self.stroke_color,
            radiusDefault=self.radius_default,
            highlightColor=self.highlight_color
        ))
1248104
@SuppressWarnings({"unchecked", "rawtypes"})
    private void populateMap(Map map, Node node) {
        Map.Entry entry = getMapEntry(node);
        if (entry != null) {
            map.put(entry.getKey(), entry.getValue());
        }
    }
86706
private void prepTemplatePlaceholders(Node fn) {
    final List<String> locals = templateLocals;
    final List<String> params = templateParams;
    final Map<String, JSType> paramTypes = new HashMap<>();

    // drop the function name so it isn't include in the name maps
    String fnName = fn.getFirstChild().getString();
    fn.getFirstChild().setString("");

    // Build a list of parameter names and types.
    Node templateParametersNode = fn.getSecondChild();
    JSDocInfo info = NodeUtil.getBestJSDocInfo(fn);
    if (templateParametersNode.hasChildren()) {
      Preconditions.checkNotNull(info,
          "Missing JSDoc declaration for template function %s", fnName);
    }
    for (Node paramNode : templateParametersNode.children()) {
      String name = paramNode.getString();
      JSTypeExpression expression = info.getParameterType(name);
      Preconditions.checkNotNull(expression,
          "Missing JSDoc for parameter %s of template function %s",
          name, fnName);
      JSType type = typeRegistry.evaluateTypeExpressionInGlobalScope(expression);
      checkNotNull(type);
      params.add(name);
      paramTypes.put(name, type);
    }

    // Find references to string literals, local variables and parameters and replace them.
    traverse(
        fn,
        new Visitor() {
          @Override
          public void visit(Node n) {
            if (n.isName()) {
              Node parent = n.getParent();
              String name = n.getString();
              if (!name.isEmpty() && parent.isVar() && !locals.contains(name)) {
                locals.add(n.getString());
              }

              if (params.contains(name)) {
                JSType type = paramTypes.get(name);
                boolean isStringLiteral =
                    type.isStringValueType() && name.startsWith("string_literal");
                replaceNodeInPlace(
                    n, createTemplateParameterNode(params.indexOf(name), type, isStringLiteral));
              } else if (locals.contains(name)) {
                replaceNodeInPlace(n, createTemplateLocalNameNode(locals.indexOf(name)));
              }
            }
          }
        });
  }
493310
def add_unique_template_variables(self, options):
        """"""

        # set line stroke dash interval based on line_stroke property
        if self.line_stroke in ["dashed", "--"]:
            self.line_dash_array = [6, 4]
        elif self.line_stroke in ["dotted", ":"]:
            self.line_dash_array = [0.5, 4]
        elif self.line_stroke in ["dash dot", "-."]:
            self.line_dash_array = [6, 4, 0.5, 4]
        elif self.line_stroke in ["solid", "-"]:
            self.line_dash_array = [1, 0]
        else:
            # default to solid line
            self.line_dash_array = [1, 0]

        # check if choropleth map should include 3-D extrusion
        self.extrude = all([bool(self.height_property), bool(self.height_stops)])

        # common variables for vector and geojson-based choropleths
        options.update(dict(
            colorStops=self.color_stops,
            colorProperty=self.color_property,
            colorType=self.color_function_type,
            defaultColor=self.color_default,
            lineColor=self.line_color,
            lineDashArray=self.line_dash_array,
            lineStroke=self.line_stroke,
            lineWidth=self.line_width,
            extrudeChoropleth=self.extrude,
            highlightColor=self.highlight_color
        ))
        if self.extrude:
            options.update(dict(
                heightType=self.height_function_type,
                heightProperty=self.height_property,
                heightStops=self.height_stops,
                defaultHeight=self.height_default,
            ))

        # vector-based choropleth map variables
        if self.vector_source:
            options.update(vectorColorStops=self.generate_vector_color_map())
            
            if self.extrude:
                options.update(vectorHeightStops=self.generate_vector_numeric_map('height'))

        # geojson-based choropleth map variables
        else:
            options.update(geojson_data=json.dumps(self.data, ensure_ascii=False))
731386
function (imageOptions) {

		imageOptions = imageOptions || {};

		var patternGuid = L.Util.guid();

		var radius = this.options.radius || Math.max(this.options.radiusX, this.options.radiusY);
		var diameter = this._getDefaultDiameter(radius);
		var imageSize = imageOptions.imageSize || new L.Point(diameter, diameter);

		var circleSize = imageOptions.radius || diameter/2;

		var shapeOptions = imageOptions.shape || {
			circle: {
				r: circleSize,
				cx: 0,
				cy: 0
			}
		};

		var patternOptions = imageOptions.pattern || {
			width: imageSize.x,
			height: imageSize.y,
			x: 0,
			y: 0
		};

		var shapeKeys = Object.keys(shapeOptions);
		var shapeType = shapeKeys.length > 0 ? shapeKeys[0] : 'circle';

		shapeOptions[shapeType].fill = 'url(#' + patternGuid + ')';

		var shape = this._createShape(shapeType, shapeOptions[shapeType]);

		if (this.options.clickable) {
			shape.setAttribute('class', 'leaflet-clickable');
		}

		patternOptions.id = patternGuid;
		patternOptions.patternUnits = patternOptions.patternUnits || 'objectBoundingBox';

		var pattern = this._createPattern(patternOptions);

		imageOptions = imageOptions.image || {
			width: imageSize.x,
			height: imageSize.y,
			x: 0,
			y: 0,
			url: this.options.imageCircleUrl
		};

		var image = this._createImage(imageOptions);
        image.setAttributeNS(L.Path.XLINK_NS, 'xlink:href', imageOptions.url);

		pattern.appendChild(image);
		this._defs.appendChild(pattern);
		this._container.insertBefore(shape, this._defs);

		this._shape = shape;
		
		var me = this;
		
		this._shape.addEventListener('mouseover', function () {
			me.fire('mouseover');
		});
		
		this._shape.addEventListener('mouseout', function () {
			me.fire('mouseout');
		});
		
		this._shape.addEventListener('mousemove', function () {
			me.fire('mousemove');
		});
		
		var anchorPoint = this.getTextAnchor();

		if (this._shape && anchorPoint) {
			if (this._shape.tagName === 'circle' || this._shape.tagName === 'ellipse') {
				this._shape.setAttribute('cx', anchorPoint.x);
				this._shape.setAttribute('cy', anchorPoint.y);
			}
			else {
				var width = this._shape.getAttribute('width');
				var height = this._shape.getAttribute('height');
				this._shape.setAttribute('x', anchorPoint.x - Number(width)/2);
				this._shape.setAttribute('y', anchorPoint.y - Number(height)/2);
			}
		}
	}
1269685
function (length, cycles, callback, scope) {
        var coords = _.isFunction(callback) && this.current();

        // validate parameter defaults
        _.isNil(length) && (length = this.length);
        _.isNil(cycles) && (cycles = this.cycles);

        // use the constructor to set the values
        Cursor.call(this, length, cycles, this.position, this.iteration);

        return coords && callback.call(scope || this, null, this.current(), coords);
    }
1061691
function map(obj, cb, context) {
    if (!(obj && cb)) {
        return;
    }
    if (obj.map && obj.map === nativeMap) {
        return obj.map(cb, context);
    }
    else {
        var result = [];
        for (var i = 0, len = obj.length; i < len; i++) {
            result.push(cb.call(context, obj[i], i, obj));
        }
        return result;
    }
}
435586
@Override
  protected void populateEdgeTemplateMap() {
    if (templateCatalog.isPresent()) {
      for (FlowEdge flowEdge : this.weightedGraph.edgeSet()) {
        edgeTemplateMap.put(flowEdge.getEdgeIdentity(), templateCatalog.get().
            getAllTemplates().
            stream().map(jobTemplate -> jobTemplate.getUri()).collect(Collectors.toList()));
      }
    }
  }
28641
function mapAttrName(node, text, maps, id, nodeId, isComponent)
  {
    var attrs = text.match(__matchAttr),
        mapText,
        mapValues,
        attr,
        title,
        value,
        item,
        len = attrs.length,
        titleMap,
        localMap,
        x = 0,
        lenn,
        i = 0;
    
    for(x;x<len;x++)
    {
      attr = attrs[x].split(':');
      title = attr[0];
      value = attr[1].replace(__replaceSingleQuotes, '');
      
      if(title.match(__matchInsert))
      {
        titleMap = new mapObject({
          local_id: id,
          node_id: nodeId,
          mapIndex: maps.length,
          mapTextIndex: 0,
          text: title,
          maps: maps,
          mapText: [title],
          type: 'attr',
          isInsert: true,
          node: node,
          isAttr: true,
          isPointer: isComponent,
          isProperty: true
        })
        maps.push(titleMap)
        titleMap.mapText = [maps[(maps.length - 1)]];
      }
      else if(title.match(__matchText))
      {
        titleMap = new mapObject({
          local_id: id,
          node_id: nodeId,
          mapIndex: maps.length,
          mapTextIndex: 0,
          text: title,
          maps: maps,
          mapText: [title],
          type: 'attr',
          node: node,
          isAttr: true,
          listener: 'setAttribute',
          local: node,
          isPointer: isComponent,
          isProperty: true
        })
        maps.push(titleMap);
        titleMap.mapText = [maps[(maps.length - 1)]];
      }
      
      mapText = splitText(value);
      mapValues = (titleMap ? titleMap.mapValues : maps);
      lenn = mapText.length;
      i = 0;
      
      for(i;i<lenn;i++)
      {
        item = mapText[i];
        if(item.match(__matchInsert))
        {
          localMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: mapValues.length,
            mapTextIndex: i,
            text: item,
            mapText: mapText,
            maps: mapValues,
            type: 'attr',
            isInsert: true,
            property: title,
            listener: title,
            node: node,
            isAttr: true,
            isPointer: isComponent,
            isPropertyValue: true
          });
          titleMap.mapValues.push(localMap)
        }
        else if(item.match(__matchText))
        {
          localMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: mapValues.length,
            mapTextIndex: i,
            text: item,
            mapText: mapText,
            maps: mapValues,
            type: 'attr',
            property: title,
            listener: title,
            node: node,
            isAttr: true,
            isPointer: isComponent,
            isPropertyValue: true
          });
          titleMap.mapValues.push(localMap)
        }
        else
        {
          localMap = item;
        }
        mapText[i] = localMap;
      }
      titleMap.values = mapText;
    }
  }
887736
function (ui, context) {
					if (context == null || (context != colorBar && context != colorMap)) positionMapAndBarArrows.call($this, ui, context);
					setTimeout(function () {
						updatePreview.call($this, ui);
						updateMapVisuals.call($this, ui);
						updateBarVisuals.call($this, ui);
					}, 0);
				}
573080
function (templateCtxt, tplSource) {

            ariaUtilsJson.setValue(this._data, "locked", true);

            if (tplSource) {
                tplSource = this._data.selectedTemplate.tplSrcEdit;
            }

            // do some cleaning
            this.clearHightlight();

            // do not close if target IS the contextual menu
            if (this._mainContextual && templateCtxt.tplClasspath != this._mainContextual.CONTEXTUAL_TEMPLATE_CLASSPATH) {
                this._mainContextual.close();
            }

            // replace in this scope Aria and aria
            var oSelf = this;
            var doIt = function () {
                // var Aria = oSelf.bridge.getAria(), aria = oSelf.bridge.getAriaPackage();

                // ... and call for reload
                templateCtxt.$reload(tplSource, {
                    fn : oSelf._unlock,
                    scope : oSelf
                });
            };
            doIt();

        }
405947
function(mapId, markersToRender, oldModels, map, layers, leafletMarkers, leafletScope,
                                 watchOptions, maybeLayerName, skips) {
        for (var newName in markersToRender) {
          if (skips[newName])
              continue;

          if (newName.search('-') !== -1) {
            $log.error('The marker can\'t use a "-" on his key name: "' + newName + '".');
            continue;
          }

          var model = Helpers.copy(markersToRender[newName]);
          var pathToMarker = Helpers.getObjectDotPath(maybeLayerName ? [maybeLayerName, newName] : [newName]);
          var maybeLMarker = _getLMarker(leafletMarkers, newName, maybeLayerName);
          if (!isDefined(maybeLMarker)) {
            //(nmccready) very important to not have model changes when lObject is changed
            //this might be desirable in some cases but it causes two-way binding to lObject which is not ideal
            //if it is left as the reference then all changes from oldModel vs newModel are ignored
            //see _destroy (where modelDiff becomes meaningless if we do not copy here)
            var marker = createMarker(model);
            var layerName = (model ? model.layer : undefined) || maybeLayerName; //original way takes pref
            if (!isDefined(marker)) {
              $log.error(errorHeader + ' Received invalid data on the marker ' + newName + '.');
              continue;
            }

            _setLMarker(marker, leafletMarkers, newName, maybeLayerName);

            // Bind message
            if (isDefined(model.message)) {
              marker.bindPopup(model.message, model.popupOptions);
            }

            // Add the marker to a cluster group if needed
            if (isDefined(model.group)) {
              var groupOptions = isDefined(model.groupOption) ? model.groupOption : null;
              addMarkerToGroup(marker, model.group, groupOptions, map);
            }

            // Show label if defined
            if (Helpers.LabelPlugin.isLoaded() && isDefined(model.label) && isDefined(model.label.message)) {
              marker.bindLabel(model.label.message, model.label.options);
            }

            // Check if the marker should be added to a layer
            if (isDefined(model) && (isDefined(model.layer) || isDefined(maybeLayerName))) {

              var pass = _maybeAddMarkerToLayer(layerName, layers, model, marker,
                  watchOptions.individual.doWatch, map);
              if (!pass)
                  continue; //something went wrong move on in the loop
            } else if (!isDefined(model.group)) {
              // We do not have a layer attr, so the marker goes to the map layer
              map.addLayer(marker);
              if (!watchOptions.individual.doWatch && model.focus === true) {
                marker.openPopup();
              }
            }

            if (watchOptions.individual.doWatch) {
              addMarkerWatcher(marker, pathToMarker, leafletScope, layers, map,
                  watchOptions.individual.isDeep);
            }

            listenMarkerEvents(marker, model, leafletScope, watchOptions.individual.doWatch, map);
            leafletMarkerEvents.bindEvents(mapId, marker, pathToMarker, model, leafletScope, layerName);
          }          else {
            var oldModel = isDefined(oldModel) ? oldModels[newName] : undefined;
            updateMarker(model, oldModel, maybeLMarker, pathToMarker, leafletScope, layers, map);
          }
        }
      }
189533
function buildRowMapping(mapping, columns, yOffset) {
  for (let i = 0; i < columns.length; i++) {
    const {icon, xOffset} = columns[i];
    const id = getIconId(icon);
    mapping[id] = Object.assign({}, icon, {
      x: xOffset,
      y: yOffset
    });
  }
}
741385
function updateListToMP (vnodeList = [], val, forInfo, context) {
  let firstItem = vnodeList[0]
  let forKeys
  let list = []
  if (!firstItem) {
    vnodeList.push(new VNode('div'))
    firstItem = vnodeList[0]
  }

  /* istanbul ignore else */
  if (firstItem) {
    // collect v-key
    if (Array.isArray(firstItem)) {
      forKeys = firstItem.map(e => {
        const { attrs = {}} = e.data || /* istanbul ignore next */ {}
        const { k_ = '' } = attrs
        return k_
      })
    } else {
      const { attrs = {}} = firstItem.data || {}
      const { k_ = '' } = attrs
      forKeys = [k_]
    }

    forKeys = forKeys.filter(e => e)

    // generate list array with v-key value
    let valToList = []
    /* istanbul ignore else */
    if (Array.isArray(val) || typeof val === 'string') {
      valToList = new Array(val.length)
      for (let i = 0, l = val.length; i < l; i++) {
        valToList[i] = val[i]
      }
    } else if (typeof val === 'number') {
      valToList = new Array(val)
      for (let i = 0; i < val; i++) {
        valToList[i] = i
      }
    } else if (isObject(val)) {
      valToList = Object.keys(val).map((e, i) => i)
    }

    list = valToList.map((e, i) => {
      if (forKeys.length === 0) {
        return i
      }
      return forKeys.reduce((res, k) => {
        res[k.replace(/\./g, '_')] = getValue(val[i], k)
        return res
      }, {})
    })
  }

  const cloneVnode = {
    context,
    data: {
      attrs: { h_: forInfo[0], f_: forInfo[1] }
    }
  }

  // TODO: try not disable key diff in patching process
  // key will reuse existing vnode which won't update the vnode content
  // see unit test: with key
  // list won't update after this.list.reverse() if it's not disable

  // if is a scoped slot list
  if (firstItem && !firstItem.fn) {
    vnodeList.forEach(vnode => {
      if (Array.isArray(vnode)) {
        vnode.forEach(c => {
          delete c.key
        })
      } else {
        delete vnode.key
      }
    })
  }

  updateVnodeToMP(cloneVnode, HOLDER_TYPE_VARS.for, list)

  const fnStoreNode = Array.isArray(firstItem) ? firstItem[0] : firstItem

  if (fnStoreNode) {
    fnStoreNode.__renderListFn = function (vnode) {
      updateVnodeToMP(vnode || cloneVnode, HOLDER_TYPE_VARS.for, list)
    }

    fnStoreNode.__renderListVnode = cloneVnode
  }
}
777396
function multiMapSet(multimap, key, value) {
  if (!multimap.has(key)) {
    multimap.set(key, new Set());
  }
  const values = multimap.get(key);
  if (!values.has(value)) {
    values.add(value);
    return true;
  }
  return false;
}
875625
function mapStyleAttr(node, text, maps, id, nodeId, isComponent)
  {
    var styles = text.match(__matchStyles),
        isFullStyle = (styles && styles[0].match(__matchText) && styles.length === 1),
        mapText,
        mapValues,
        style,
        title,
        value,
        item,
        len = styles.length,
        titleMap,
        localMap,
        x = 0,
        lenn,
        i = 0;
    
    if(isFullStyle)
    {
      item = styles[0];
      if(item.match(__matchInsert))
      {
        localMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: maps.length,
            mapTextIndex: 0,
            text: item,
            maps: maps,
            mapText: [item],
            type: 'style',
            isInsert: true,
            property: 'style',
            local: node.style,
            node: node,
            isInlineStyle: true,
            isFullStyle: true,
            isPointer: isComponent
          })
          maps.push(localMap)
          localMap.mapText = [maps[(maps.length - 1)]];
      }
      else if(item.match(__matchText))
      {
        localMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: maps.length,
            mapTextIndex: 0,
            text: item,
            maps: maps,
            mapText: [item],
            type: 'style',
            property: 'style',
            listener: 'style',
            local: node.style,
            node: node,
            isInlineStyle: true,
            isFullStyle: true,
            isPointer: isComponent
          })
          maps.push(localMap)
          localMap.mapText = [maps[(maps.length - 1)]];
      }
    }
    else
    {
      for(x;x<len;x++)
      {
        if(styles[x].indexOf(':') === -1)
        {
          title = styles[x];
          value = '';
        }
        else
        {
          style = styles[x].split(':');
          title = style[0];
          value = style[1];
        }
        /* First we try to match the title */
        if(title.match(__matchInsert))
        {
          titleMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: maps.length,
            mapTextIndex: 0,
            text: title,
            maps: maps,
            mapText: [title],
            type: 'style',
            isInsert: true,
            property: 'style',
            node: node,
            local: node.style,
            isFullProp: !(value),
            isInlineStyle: true,
            isPointer: isComponent,
            isProperty: true
          })
          maps.push(titleMap)
          titleMap.mapText = [maps[(maps.length - 1)]];
        }
        else if(title.match(__matchText))
        {
          titleMap = new mapObject({
            local_id: id,
            node_id: nodeId,
            mapIndex: maps.length,
            mapTextIndex: 0,
            text: title,
            maps: maps,
            mapText: [title],
            type: 'style',
            property: 'style',
            node: node,
            local: node.style,
            isFullProp: !(value),
            isInlineStyle: true,
            isPointer: isComponent,
            isProperty: true
          })
          maps.push(titleMap)
          titleMap.mapText = [maps[(maps.length - 1)]];
        }
        else
        {
          titleMap = undefined;
        }
        /* Then we try to match the value */
        mapText = splitText(value);
        mapValues = (titleMap ? titleMap.mapValues : maps);
        lenn = mapText.length;
        i = 0;

        for(i;i<lenn;i++)
        {
          item = mapText[i];
          if(item.match(__matchInsert))
          {
            localMap = new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: mapValues.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: mapValues,
              node: node,
              type: 'style',
              isInsert: true,
              property: title,
              local: node.style,
              localAttr: title,
              isInlineStyle: true,
              isPointer: isComponent,
              isPropertyValue: true
            })
            if(!titleMap)
            {
              maps.push(localMap);
              localMap.mapText = [maps[(maps.length - 1)]];
            }
            else
            {
              titleMap.mapValues.push(localMap)
            }
          }
          else if(item.match(__matchText))
          {
            localMap = new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: mapValues.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: mapValues,
              node: node,
              type: 'style',
              property: title,
              listener: title,
              local: node.style,
              localAttr: title,
              isInlineStyle: true,
              isPointer: isComponent,
              isPropertyValue: true
            })
            if(!titleMap)
            {
              maps.push(localMap);
              localMap.mapText = [maps[(maps.length - 1)]];
            }
            else
            {
              titleMap.mapValues.push(localMap)
            }
          }
          else
          {
            localMap = item;
          }
          mapText[i] = localMap;
        }
        if(titleMap) titleMap.values = mapText;
      }
    }
  }
173288
protected function _updateCircle()
    {
        // Sort the circle
        ksort($this->_circle);

        // Now that the hashes are sorted, generate numeric indices into the
        // circle.
        $this->_pointMap = array_keys($this->_circle);
        $this->_pointCount = count($this->_pointMap);
    }