<commit_before>import {Model} from './Model';
import {X, Y, SHAPE, SIZE} from '../channel';
import {applyColorAndOpacity, ColorMode} from './util';

export namespace point {
  export function markType() {
    return 'symbol';
  }

  export function properties(model: Model, fixedShape?: string) {
    // TODO Use Vega's marks properties interface
    var p: any = {};

    // x
    if (model.has(X)) {
      p.x = {
        scale: model.scaleName(X),
        field: model.field(X, { binSuffix: '_mid' })
      };
    } else {
      p.x = { value: 21 /* config.scale.bandWidth */ / 2 };
    }

    // y
    if (model.has(Y)) {
      p.y = {
        scale: model.scaleName(Y),
        field: model.field(Y, { binSuffix: '_mid' })
      };
    } else {
      p.y = { value: 21 /* config.scale.bandWidth */ / 2 };
    }

    // size
    if (model.has(SIZE)) {
      p.size = {
        scale: model.scaleName(SIZE),
        field: model.field(SIZE)
      };
    } else {
      p.size = { value: model.sizeValue() };
    }

    // shape
    if (fixedShape) { // square and circle marks
      p.shape = { value: fixedShape };
    } else if (model.has(SHAPE)) {
      p.shape = {
        scale: model.scaleName(SHAPE),
        field: model.field(SHAPE)
      };
    } else if (model.fieldDef(SHAPE).value) {
      p.shape = { value: model.fieldDef(SHAPE).value };
    } else {
      p.shape = { value: model.config().mark.shape };
    }

    applyColorAndOpacity(p, model,
      // square and circle are filled by default, but point is stroked by default.
      fixedShape ? ColorMode.FILLED_BY_DEFAULT : ColorMode.STROKED_BY_DEFAULT<commit_msg>Don’t output empty shape<commit_after>import {Model} from './Model';
import {X, Y, SHAPE, SIZE} from '../channel';
import {applyColorAndOpacity, ColorMode} from './util';

export namespace point {
  export function markType() {
    return 'symbol';
  }

  export function properties(model: Model, fixedShape?: string) {
    // TODO Use Vega's marks properties interface
    var p: any = {};

    // x
    if (model.has(X)) {
      p.x = {
        scale: model.scaleName(X),
        field: model.field(X, { binSuffix: '_mid' })
      };
    } else {
      p.x = { value: 21 /* config.scale.bandWidth */ / 2 };
    }

    // y
    if (model.has(Y)) {
      p.y = {
        scale: model.scaleName(Y),
        field: model.field(Y, { binSuffix: '_mid' })
      };
    } else {
      p.y = { value: 21 /* config.scale.bandWidth */ / 2 };
    }

    // size
    if (model.has(SIZE)) {
      p.size = {
        scale: model.scaleName(SIZE),
        field: model.field(SIZE)
      };
    } else {
      p.size = { value: model.sizeValue() };
    }

    // shape
    if (fixedShape) { // square and circle marks
      p.shape = { value: fixedShape };
    } else if (model.has(SHAPE)) {
      p.shape = {
        scale: model.scaleName(SHAPE),
        field: model.field(SHAPE)
      };
    } else if (model.fieldDef(SHAPE).value) {
      p.shape = { value: model.fieldDef(SHAPE).value };
    } else if (model.config().mark.shape) {
      p.shape = { value: model.config().mark.shape };
    }

    applyColorAndOpacity(p, model,
      // square and circle are filled by default, but point is stroked by default.
      fixedShape ? ColorMode.FILLED_BY_DEFAULT : ColorMode.STROKED_BY_DEFAULT
{'fraction_non_alphanumeric': 0.15379975874547647, 'fraction_numerical': 0.0036188178528347406, 'mean_word_length': 2.114553990610329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3363740', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1089, 'n_words': 262}